opentelemetry-ruby icon indicating copy to clipboard operation
opentelemetry-ruby copied to clipboard

Add Kubernetes resource detection

Open fbogsany opened this issue 4 years ago • 7 comments

JS does this as part of the GCP resource detection, which doesn't seem quite right: https://github.com/open-telemetry/opentelemetry-js/blob/40242aef5f0805cc6eba369faa642f9172bf24b2/packages/opentelemetry-resource-detector-gcp/src/detectors/GcpDetector.ts#L67-L82

fbogsany avatar Sep 16 '20 11:09 fbogsany

We're doing the same thing 🙃 https://github.com/open-telemetry/opentelemetry-ruby/blob/master/resource_detectors/lib/opentelemetry/resource/detectors/google_cloud_platform.rb#L32-L38

robertlaurin avatar Sep 16 '20 13:09 robertlaurin

🤔 interesting! @mat-rumian are you running your service in GKE or somewhere else? Also, I'm not having much luck finding the Python implementation of resource detectors for GCP - I don't know where the k8s.* attributes are coming from there.

@robertlaurin our implementation differs slightly from the JS implementation - they read the values (mostly) from environment variables. I think ours is "more correct", but it isn't working in Mat's environment. Let's hear from him before we decide how to deal with it.

fbogsany avatar Sep 16 '20 15:09 fbogsany

@fbogsany I'm running my service @ AWS EKS Cluster - I have few applications intrumented by OpenTelemetry: java, python, dotnet and ruby. Only ruby in configuration: app - OTLP -> otel-collector-contrib(with k8s_tagger processor) is not generating k8s tags. All other instrumentations like java, python, dotnet do - k8s tags like k8s.namespace, k8s.container.name are present

mat-rumian avatar Sep 16 '20 20:09 mat-rumian

We don't currently have resource detection for AWS, but it's in our backlog. See open-telemetry/opentelemetry-ruby-contrib#20.

mwear avatar Sep 16 '20 20:09 mwear

I am in GKE and not seeing any k8s stuff with my traces, though I'd love to. Happy to help test if I need to turn on something for the resource detector to be activated.

I found the docs and will be opening PRs on my apps to add it

genebean avatar Sep 18 '20 00:09 genebean

I deployed this today and got back several resources about the host, cloud, and k8s.

genebean avatar Sep 18 '20 17:09 genebean

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

github-actions[bot] avatar Apr 27 '24 01:04 github-actions[bot]