Skip to content

[Bug]: Prometheus: Using without_scope_info breaks with_resource_selector(ResourceSelector::All) #2858

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

Open
Sushisource opened this issue Mar 25, 2025 · 2 comments
Labels
bug Something isn't working triage:todo Needs to be traiged.

Comments

@Sushisource
Copy link
Contributor

What happened?

See title. If you use without scope info, labels from a Resource are not applied exported metrics, even if you chose ResourceSelector::All.

The problematic bit of code is here: https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-prometheus/src/lib.rs#L324

OpenTelemetry API Version (i.e version of opentelemetry crate)

0.26

But for the prometheus crate, specifically commit e911383 because I was on 0.26 of everything else before that crate upgraded

Regardless, this code appears unchanged since then

OpenTelemetry SDK Version (i.e version of opentelemetry_sdk crate)

0.26

What Exporter(s) are you seeing the problem on?

Prometheus

Relevant log output

@cijothomas
Copy link
Member

cijothomas commented Mar 25, 2025

The best suggestion I can give at the moment is to see if you can switch to OTLP Exporter given OTLP is now accepted by Prometheus. We are not actively developing Prom dedicated exporter to focus on getting things to 1.0/stable!

If you need help setting up OTLP for Prometheus, I can help!

@Sushisource
Copy link
Contributor Author

That's a bit tough for me given that I'm authoring a library, so my users find it very convenient to consume Prom metrics directly. I can make a PR to fix the issue if that'll be accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage:todo Needs to be traiged.
Projects
None yet
Development

No branches or pull requests

2 participants