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

[k8sattributesprocessor] The sources.from types add enum metric_attribute #32596

Closed
halleystar opened this issue Apr 22, 2024 · 9 comments
Closed
Labels
closed as inactive enhancement New feature or request needs triage New item requiring triage processor/k8sattributes k8s Attributes processor Stale

Comments

@halleystar
Copy link

Component(s)

processor/k8sattributes

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

I want to add pod labels to some metric。But I can not finish this easily。for example when I get some metric about pod by intermediary system。

Describe the solution you'd like

we can add sources.from a enum metric_attribute to match data point's attribute and then fetch pod labels。

Describe alternatives you've considered

No response

Additional context

No response

@halleystar halleystar added enhancement New feature or request needs triage New item requiring triage labels Apr 22, 2024
@github-actions github-actions bot added the processor/k8sattributes k8s Attributes processor label Apr 22, 2024
Copy link
Contributor

Pinging code owners:

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

@TylerHelmuth
Copy link
Member

@halleystar I think your need would be better served by the transformprocessor, have you looked into that processor yet? It can add resource attributes based on datapoint attributes.

@TylerHelmuth
Copy link
Member

Or are you saying the pod association would come from a datapoint attribute instead of a resource attribute?

@halleystar
Copy link
Author

Thank you for your reply. I have learned about transformprocessor, but it does not seem to meet my needs. The transformprocessor requires all attributes to exist in source_attribute or data_points, but for the metrics of the pod obtained from the intermediary service, the pod-related label attribute does not exist. Need to be obtained from the pod.

@TylerHelmuth
Copy link
Member

@halleystar is your goal to do pod association using a datapoint attribute or to add pod labels to only some metrics?

@halleystar
Copy link
Author

yeah, do pod association using a datapoint attribute

@TylerHelmuth
Copy link
Member

I don't think that would be impossible, but would be very tricky as not all the datapoints in a payload would be guaranteed to have the same value. How would the association work if there are 2 datapoints that have different attribute values?

In the meantime you can solve your problem using a transformprocessor before the k8sattributesprocessor to set a resource attribute using a datapoint attribute

set(resource.attributes["test"], attributes["test"])

Copy link
Contributor

github-actions bot commented Jul 1, 2024

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

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

Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed as inactive enhancement New feature or request needs triage New item requiring triage processor/k8sattributes k8s Attributes processor Stale
Projects
None yet
Development

No branches or pull requests

2 participants