Custom log on stackdriver with Apigee Hybrid

Hello everyone,

i need to send custom logs on Stackdriver with Apigee Hybrid. Unfortunately, i can't enable extensions.

I saw that i can call the Stackdriver API to log an entry on my project, but, obviously, i need the Authorization Bearer Token to call the API.

I was able to obtain the Authorization Bearer Token with Google Cloud SDK.

How i can retrieve the same inside the proxy on Apigee?

0 2 252
2 REPLIES 2

Have you looked at this post for Apigee X: https://www.googlecloudcommunity.com/gc/Apigee/Stackdriver-extension-in-Apigee-X/m-p/168228/highligh...

I believe that feature is now available on 1.6.x for Apigee Hybrid. See docs: https://cloud.google.com/apigee/docs/api-platform/security/google-auth/overview

Yes, you don't need to "manually" obtain a bearer token from within your API Proxy. Apigee will do that for you, if you use the new google-auth feature Arghya referenced.

You can follow THIS policy example to log to Google Cloud Logging (f.k.a Stackdriver): https://github.com/apigee/devrel/blob/main/references/cloud-logging-shared-flow/sharedflowbundle/pol...