Gcp Notes/gcp cloudevents

From Federal Burro of Information
Revision as of 00:03, 10 November 2022 by David (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Intro

You can use gcp cloud funtions to eat gcp logging events.

gcp logging -----> gcp eventarc              --> gcp cloud functions
( lots of data )   ( filter on _this_ event)     ( run _this_ code )

The hardest part for me is how to handle different types of events.

the cloud event object has a property called payload, but is that an object ? or a dict?

the cloud event object can be treated as a dist, cloudevent['field']

References

https://medium.com/google-cloud/using-cloud-events-and-cloud-events-generator-4b71b8a90277


sample code for event log
https://cloud.google.com/functions/docs/samples/functions-log-cloudevent