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

service.name: replace app.kubernetes.io/component to app.kubernetes.io/name #26

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

tetianakravchenko
Copy link
Contributor

container with name: prometheus-server - has a service.name : prometheus - that is set from pod label app.kubernetes.io/name:

kubectl describe pod prometheus-server-server-64ddbf6c85-r7tk5 | grep "Labels:" -a5
...
Labels:           app.kubernetes.io/component=server
                  app.kubernetes.io/instance=prometheus-server
                  app.kubernetes.io/managed-by=Helm
                  app.kubernetes.io/name=prometheus
                  app.kubernetes.io/part-of=prometheus
                  app.kubernetes.io/version=v2.54.1
Screenshot 2024-10-11 at 12 42 43

@@ -121,8 +121,8 @@ collectors:
- "k8s.pod.uid"
- "k8s.pod.start_time"
labels:
- tag_name: app.label.component
key: app.kubernetes.io/component
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChrsMark for some reason here was used app.kubernetes.io/component for service.name - it was introduced in the original version of the manifest, maybe you remember reasoning for that? or it was a mistake and it should be app.kubernetes.io/name ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly it was an assumption borrowed from OTel demo: https://github.com/open-telemetry/opentelemetry-helm-charts/blob/3a6fff3f065dafcdcf7041885c5d0d1bf61a1167/charts/opentelemetry-demo/values.yaml#L4-L14.

I'm not sure if that's coming from a spec definition or something so I think it's not a hard rule. However, whatever we choose we should ensure that it's the way forward. See open-telemetry/semantic-conventions#236

@rogercoll do you have maybe more context on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!
by those changes I am replicating ingest pipeline we use for logs - https://github.com/elastic/integrations/blob/main/packages/kubernetes/data_stream/container_logs/elasticsearch/ingest_pipeline/default.yml

and it seems to align with the candidates in open-telemetry/semantic-conventions#236

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern is that OTel demo uses the app.kubernetes.io/component which might bring issues in signal correlation. I wonder if we could propose this as a change to OTel demo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have both labels?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern is that OTel demo uses the app.kubernetes.io/component which might bring issues in signal correlation. I wonder if we could propose this as a change to OTel demo.

Good catch! I agree with you both, the OTel demo should be using app.kubernetes.io/name instead of the current app.kubernetes.io/component. At least based on the definition of this well-known attributes: https://kubernetes.io/docs/reference/labels-annotations-taints/ and SemConv.

Just created this issue upstream to track the changes: open-telemetry/opentelemetry-helm-charts#1383

Copy link
Contributor

@rogercoll rogercoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we will just need to be aware that with the otel-demo deployment the correlation will fail until we don't update the https://github.com/elastic/opentelemetry-demo/blob/main/kubernetes/elastic-helm/deployment.yaml#L6

@@ -121,8 +121,8 @@ collectors:
- "k8s.pod.uid"
- "k8s.pod.start_time"
labels:
- tag_name: app.label.component
key: app.kubernetes.io/component
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern is that OTel demo uses the app.kubernetes.io/component which might bring issues in signal correlation. I wonder if we could propose this as a change to OTel demo.

Good catch! I agree with you both, the OTel demo should be using app.kubernetes.io/name instead of the current app.kubernetes.io/component. At least based on the definition of this well-known attributes: https://kubernetes.io/docs/reference/labels-annotations-taints/ and SemConv.

Just created this issue upstream to track the changes: open-telemetry/opentelemetry-helm-charts#1383

@tetianakravchenko tetianakravchenko merged commit 4d6f1b9 into elastic:main Oct 14, 2024
1 check passed
@tetianakravchenko tetianakravchenko deleted the fix_service-name branch October 14, 2024 07:43
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.

4 participants