open-telemetry / opentelemetry-ruby

OpenTelemetry Ruby API & SDK, and related gems
https://opentelemetry.io/
Apache License 2.0
486 stars 239 forks source link

Add Kubernetes resource detection #385

Closed fbogsany closed 4 months ago

fbogsany commented 4 years ago

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

robertlaurin commented 4 years ago

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

fbogsany commented 4 years ago

🤔 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.

mat-rumian commented 4 years ago

@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

mwear commented 4 years ago

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

genebean commented 4 years ago

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 commented 4 years ago

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

github-actions[bot] commented 5 months ago

👋 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.