Skip to content

Add GCP resource detector #383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

dashpole
Copy link
Contributor

@dashpole dashpole commented May 4, 2022

This implements resource detection for GCE, GKE, Cloud Run, Cloud Functions, and App Engine. It doesn't split out logic into a non-otel package, which can be done as a follow-up.

Breaking changes from the opentelemetry-go-contrib gcp detector:

  • Detectors for each platform are combined into a single detector
  • No longer supports detecting k8s.pod.name, container.name, k8s.namespace.name. These are expected to be set outside of this resource detector.
  • No longer sets service.namespace to "cloud-run-managed"
  • Sets faas.name instead of service.name in cloud run
  • Sets faas.id instead of service.instance.id in cloud run

Additions:

  • Adds detector for Google App Engine
  • Now correctly sets cloud.platform on GKE and Cloud Run
  • Now detects cloud.availability_zone/region when running on GKE with workload identity enabled (the GCE metadata server is not accessible in that scenario)
  • Now detects faas.version on cloud run and cloud functions.

@dashpole dashpole force-pushed the resource_detection branch from ca93a1f to 4382a18 Compare May 4, 2022 19:59
@dashpole dashpole requested review from aabmass and damemi May 4, 2022 19:59
@dashpole dashpole force-pushed the resource_detection branch from 4382a18 to 91065fa Compare May 4, 2022 20:05
@dashpole
Copy link
Contributor Author

dashpole commented May 5, 2022

I raised this at the Go sig. I'll plan to split this between our repo, and upstream. This repo should not depend on semconv.

@dashpole dashpole marked this pull request as draft May 5, 2022 20:50
@dashpole dashpole mentioned this pull request May 13, 2022
@dashpole dashpole closed this May 13, 2022
@dashpole
Copy link
Contributor Author

Closing in favor of #394

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant