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

DataPoint Attributes to Resource Attributes Conversion #32120

Closed
AlessandroFazio opened this issue Apr 2, 2024 · 5 comments
Closed

DataPoint Attributes to Resource Attributes Conversion #32120

AlessandroFazio opened this issue Apr 2, 2024 · 5 comments
Labels
needs triage New item requiring triage receiver/prometheus Prometheus receiver

Comments

@AlessandroFazio
Copy link

Component(s)

receiver/prometheus

Describe the issue you're reporting

Hello, I have setup the Collector with a Prometheus Receiver to scrape metrics from targets and added to the scrape_config some prometheus metrics labels. I need these informations to be able to store metrics data in Opensearch indexes based on the value of these labels.

The prometheus receiver put these metrics labels into metric data point attributes when converting in Otel format. However for my use case I need them to be placed in the resource attributes instead. So, I started looking at processors which could help me in this regard.

Unfortunately, I hadn't find anything yet for my use case. This is what I found:

  • Resource Processor seems to be scoped to resource attributes, not being able to lookup metric data point attribute
  • Attribute Processor and Metrics Transform Processor both deals with telemetry data point attributes, but it seems they cannot add resource attributes

Maybe you can help me pointing to some material which I overlooked or some other workaround. Thanks in advance for your time.

@AlessandroFazio AlessandroFazio added the needs triage New item requiring triage label Apr 2, 2024
Copy link
Contributor

github-actions bot commented Apr 2, 2024

Pinging code owners:

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

@github-actions github-actions bot added the receiver/prometheus Prometheus receiver label Apr 2, 2024
@dashpole
Copy link
Contributor

dashpole commented Apr 2, 2024

You are probably looking for the groupbyattrs processor: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/groupbyattrsprocessor

@dashpole
Copy link
Contributor

dashpole commented Apr 2, 2024

Let me know if you run into any issues

@AlessandroFazio
Copy link
Author

AlessandroFazio commented Apr 2, 2024

Much thanks for the quick reply @dashpole.

It definitely looks like the right tool for the job. I tried it and it works perfectly. It seems that this processor gives other advanced capability which looks interesting. Much thanks.

Unfortunately it is not included yet in AWS Otel Collector (ADOT). Hope the will add it to their OtelCol distro. This is not a requirement for me, just a nice to have.

Thank you again, you can close this issue.

@dashpole
Copy link
Contributor

dashpole commented Apr 2, 2024

happy to help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage New item requiring triage receiver/prometheus Prometheus receiver
Projects
None yet
Development

No branches or pull requests

2 participants