GoogleCloudPlatform / opentelemetry-operations-java

Apache License 2.0
71 stars 41 forks source link

<Question> Cloud function Auto instrumentation query ? #325

Closed Santosh-Kumar-Perumal closed 3 months ago

Santosh-Kumar-Perumal commented 4 months ago

Cloud function comes with out of the box auto instrumentation support can we override with Auto-Configuration for OpenTelemetry using the below approach to instrument our Java Cloud function?

https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/tree/main/exporters/auto

psx95 commented 4 months ago
  1. Could you confirm what you mean by "out of the box auto instrumentation support" for Cloud Functions ?
  2. Can you use auto exporter to export telemetry from a Cloud Function?
    • You should be able to but we don't have a sample for this particular use case. Are you running into issues with this ?
Santosh-Kumar-Perumal commented 4 months ago

Could you confirm what you mean by "out of the box auto instrumentation support" for Cloud Functions? I mean to say I am able to see cloud trace for cloud function by default.

Can you use auto exporter to export telemetry from a Cloud Function? You should be able to, but we don't have a sample for this particular use case. Are you running into issues with this? I was thinking to start integrating with auto exporter but as the cloud function already sending the trace to cloud trace by default so wanted to check if we can override it with auto exporter.

psx95 commented 4 months ago

I'm not sure how the existing traces are being generated from the cloud function, but if you create OpenTelemetry Spans from your Cloud Functions code, you should be able to use auto-exporter to export it to Cloud Trace.

Santosh-Kumar-Perumal commented 3 months ago

Thanks, @psx95 was able to override the cloud function out of the box instrumentation with Open Telemetry instrumentation Closing the issue.