The reasoning behind the choice framework boils all the way down to answering these questions: 

  1. Does the Google Cloud service or utility assist Audit Logs, Pub/Sub, or each?
  2. When each Audit Logs and Pub/Sub are supported, does the Audit Log entry have extra or totally different information than the Pub/Sub message or vice versa?
  3. Within the Pub/Sub case, do you care about standardizing on Eventarc and CloudEvents format and the comfort of not having to create Pub/Sub matters and subscriptions?

Let’s discover these questions with some concrete eventualities. 

Within the customized utility state of affairs, there aren’t any Audit Logs as a result of it’s not a Google Cloud service, so that you solely want to contemplate Pub/Sub choices. The query then turns into whether or not you need to get Pub/Sub messages immediately or by way of Eventarc. Pub/Sub might be the extra acquainted route whereas Eventarc supplies a typical approach of receiving occasions from a number of sources and a typical CloudEvent format. That is helpful in the event you intend to learn from a number of occasion sources and never simply from Pub/Sub.

If you wish to learn occasions from a Google Cloud service that helps solely Audit Logs, then your solely possibility is Eventarc. 

It turns into extra attention-grabbing when a Google Cloud service helps each Audit Logs and Pub/Sub (e.g., Cloud Construct, Cloud Storage). In these instances, the kind/content material of Audit Logs and Pub/Sub messages ought to drive your alternative. 

For instance, Cloud Storage can generate Audit Logs and it will possibly additionally ship a message to a Pub/Sub subject when a brand new object is created. The contents (bucket identify, object identify) and latency of each are roughly the identical, so you’ll be able to select both.

Cloud Construct may also generate each Audit Logs and Pub/Sub messages however the Pub/Sub based build notifications have construct standing (success, failure) whereas Audit Logs of Cloud Build primarily present information about admin operations similar to construct creation and deletion. If construct standing is essential, it is smart to decide on Pub/Sub over Audit Logs.

In each Cloud Storage and Cloud Construct, in the event you go together with Pub/Sub, you continue to have to determine whether or not you’ll learn them with or with out Eventarc. As already defined within the customized utility state of affairs, this can be a alternative between a well-known setup with Pub/Sub vs. comfort and standardization that comes with Eventarc and CloudEvents. 

I ought to word that Eventarc goals to enhance upon its occasion sources and contents of occasions in future iterations. It is best to anticipate to see richer occasions past what Audit Logs present at the moment.

As all the time, be happy to achieve out to me on Twitter @meteatamel for any questions or suggestions.





Leave a Reply

Your email address will not be published. Required fields are marked *