-
Notifications
You must be signed in to change notification settings - Fork 796
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 handles instrumentation scope and prevents collisions #3467
Comments
Not sure if this is related or not, but we're hitting an issue with the prometheus exporter and the http instrumentation. I added some debug logging and it looks like the histograms created by the instrumentation-http get created twice? This results in a serialization error where TYPE, HELP, UNIT get duplicated -- only reason why I think it might not be the same issue as above is that these histograms are created under the same scope: Debug code: for (let metric of metrics.scopeMetrics) {
console.log(`scope: ${metric.name}`)
for (const data of metric.metrics) {
console.log(data.descriptor)
} prints:
And serializes to:
|
To me that looks like a related, but different issue. One reason why comments may be duplicated is because the same metric exists in multiple scopes, which this issue was opened to address. It looks like you've encountered a bug in which each unique set of labels for a metric produces a new set of HELP, UNIT, and TYPE comments, which it should not do. |
I've narrowed it down to the autoloader -- the Instrumentation constructor inits the metrics first, then the call to Would you like me to create a separate issue? |
I would prefer a separate issue, thanks! |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stale for 14 days with no activity. |
I would appreciate if this was reopened. It is still relevant. |
Now that open-telemetry/opentelemetry-specification#2703 is released, we can update the prometheus exporter to make use of OpenTelemetry scope, particularly for reducing collisions between metrics with the same name.
Describe the solution you'd like
There are a few components:
otel_scope_name
andotel_scope_version
attributes to all metrics based on the instrumentation scope name and version.otel_scope_info
metric following https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#instrumentation-scope-1.Note that the exporter SHOULD do the above by default, but may allow disabling the behavior.
Also, note the consideration described in open-telemetry/opentelemetry-python#3072 (comment) around grouping metrics from different scopes together in the exposition.
The text was updated successfully, but these errors were encountered: