-
Notifications
You must be signed in to change notification settings - Fork 771
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
Prometheus Exporter; add resource labels to all metrics based on config flag #5529
Comments
One thing to verify, before starting to work on code... does the otel specification have anything to say on this topic? If this is something that the OTel prometheus support should be doing in all languages, then it needs to get into the specification, so it can be done the same way across all the language implementations. |
So in the spec, there is a description for the Prometheus exporter format, specifically: Prometheus OpenMetrics compatibility I find the description somewhat ambiguous though. The important part:
If I read that correctly, first it mentions to combine
Which in itself is a conflicting statement? Not sure where to properly get this addressed? (I'll try on the Cloud Native - OTel specification Slack). But for me, transforming |
Closing, as the Java Prometheus Exporter is working according to the spec as discussed on the Cloud Native Slack |
Do we know why this was closed? The slack thread seems have to have archived. Also I tried setting |
The Slack thread is still available to me, in the Cloud Native Computing Slack organization, But the gist of it is that the Prometheus Exporter works according to the specification. And so first the spec would need to change, as otherwise this exporter would work differently than all other exporters. Hope that clears it up. |
Is your feature request related to a problem? Please describe.
The Prometheus Exporter currently creates a
target_info
metric, based on a issue filed earlier.I believe writing the
target_info
itself is fine. But at least as far as I can see not adding Resource labels to all the other metrics is problematic when scraping and processing metrics purely by Prometheus. Because unless I'm missing something, there is no way for Prometheus scrape configuration to pick up thetarget_info
and add those labels to all other metrics. Which in turn makes it not possible to filter metrics e.g. byservice.name
.Describe the solution you'd like
I'd like for a configuration flag / setting to add the Resource information to all metrics, so that they can be discovered properly in Prometheus.
Describe alternatives you've considered
I've looked at ways to pick up metrics from
target_info
and add them to all metrics, e.g. viarelabeling_config
for Prometheus but this doesn't seem to be possible.Additional context
The Collector Prometheus Exporter has a specific flag to set this:
resource_to_telemetry_conversion
, see https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/prometheusexporterI'm happy to provide a PR myself to create a flag and add this (based on my request above). But would first like to have a discussion whether I overlooked something or missed something, before putting in the time.
The text was updated successfully, but these errors were encountered: