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

support k8s.pod.hostname #18494

Closed
alburthoffman opened this issue Feb 9, 2023 · 6 comments
Closed

support k8s.pod.hostname #18494

alburthoffman opened this issue Feb 9, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request priority:p3 Lowest processor/k8sattributes k8s Attributes processor

Comments

@alburthoffman
Copy link
Contributor

Component(s)

processor/k8sattributes

Is your feature request related to a problem? Please describe.

Spans from our client contain a host attribute, which is pod's hostname in the metadata.
And the bad news is pod's name is a little different from hostname.

Describe the solution you'd like

refer to this function: https://github.com/alburthoffman/opentelemetry-collector-contrib/blob/main/processor/k8sattributesprocessor/internal/kube/client.go#L288

We want to associate pod metadata based on the host attribute. But since k8s processor only support pod name, we could not do this.

Describe alternatives you've considered

had tried to constructs the pod name from the host attribute, but it requires using regex to extract substring.
And it also assumes that the name convention as well.

Overall it is not a good idea to do that by binding the name convention in our side.

Additional context

No response

@alburthoffman alburthoffman added enhancement New feature or request needs triage New item requiring triage labels Feb 9, 2023
@github-actions github-actions bot added the processor/k8sattributes k8s Attributes processor label Feb 9, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@dmitryax
Copy link
Member

dmitryax commented Feb 9, 2023

@alburthoffman how would you fetch the pod host name from k8s API?

@alburthoffman
Copy link
Contributor Author

the hostname is a part of pod spec, which is described here: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-hostname-and-subdomain-fields

@dmitryax
Copy link
Member

I see. Ideally the hostname first should be added here https://github.com/open-telemetry/opentelemetry-specification/blob/main/semantic_conventions/resource/k8s.yaml#L48 ? Can you submit a PR for semantic conventions and the k8sattributes processor?

@dmitryax dmitryax added priority:p3 Lowest and removed needs triage New item requiring triage labels Feb 10, 2023
@alburthoffman
Copy link
Contributor Author

sounds good. working on it. Thx

@codeboten
Copy link
Contributor

Fixed by #18506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority:p3 Lowest processor/k8sattributes k8s Attributes processor
Projects
None yet
Development

No branches or pull requests

3 participants