Skip to content
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

Proposal: Define mapping from k8s well-known labels to semconv #236

Open
smithclay opened this issue Aug 7, 2023 · 4 comments
Open

Proposal: Define mapping from k8s well-known labels to semconv #236

smithclay opened this issue Aug 7, 2023 · 4 comments
Assignees
Labels

Comments

@smithclay
Copy link

smithclay commented Aug 7, 2023

Many OpenTelemetry users run their applications in Kubernetes, where it is useful to use a collector processor like k8sattributes to enrich metrics, spans, or logs with k8s metadata like pod name.

The k8sattributes processor also supports enriching metrics, logs, and spans with resource attributes based on Kubernetes labels, including Well Known Labels. It would be helpful to OpenTelemetry users what the recommended best practice is for mapping well-known labels to OpenTelemetry resource attributes.

Two of the most obvious candidates (but open for feedback), are:

  • app.kubernetes.io/name -> service.name
  • app.kubernetes.io/version -> service.version

To configure k8sattributes to apply these rules, the collector YAML looks like this: https://github.com/lightstep/otel-collector-charts/blob/main/charts/otel-cloud-stack/values.yaml#L166-L168

It seems like these recommendations could (should?) live as an section in this doc: https://opentelemetry.io/docs/specs/otel/resource/semantic_conventions/k8s/

@smithclay
Copy link
Author

cc @dmitryax

@arminru
Copy link
Member

arminru commented Sep 28, 2023

To configure k8sattributes to apply these rules, the collector YAML looks like this.

@smithclay The "like this" link does not work (any longer)

@smithclay
Copy link
Author

To configure k8sattributes to apply these rules, the collector YAML looks like this.

@smithclay The "like this" link does not work (any longer)

Updated here: https://github.com/lightstep/otel-collector-charts/blob/main/charts/otel-cloud-stack/values.yaml#L166-L168 -- thank you!

@joaopgrassi
Copy link
Member

This was closed by mistake by the stale bot. Re-opening

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

No branches or pull requests

5 participants