-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 does not convert time units to seconds #18903
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
The specification requires that the unit be handled as follows:
That does not include changing the unit to a different unit or modifying the value in any way. |
Since the Prometheus exporter is the concern of the collector, I think the client should never know that the data that it published in OTLP format will be converted to Prometheus format. Because of this, I think any unit that is supported by OTLP should work and the client should not care. Maybe the Prometheus exporter is not configured right now but it will be starting from tomorrow. I think making a change on the exporters should not involve changing all the clients. Can this behavior lead to impossible scenarios?
|
The bold part is not happening. The included actual result above shows the metric name from the Prometheus exporter is |
The OTel collector had/have multiple bugs around this: - The time unit is not converted to `seconds` (Prometheus' default) - The time unit was not even visible in the name of the time series, this violated the OTel specification This means that if you sent 123ms to the OTLP collector, on Prometheus side this turned into 123s (the value is the same and not having the unit means `seconds`). See: open-telemetry/opentelemetry-collector-contrib#18903 It seems units are still not converted but at least the unit is in the name now (breaking change), see: open-telemetry/opentelemetry-collector-contrib#20519 Because of this breaking change, our tests are also broken and we need to add the unit to our assertions. Closes gh-3796
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 Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@Aneurysm9 Could you please check the last two comments and mark this issue so that it won't be auto-closed? |
This is now happening in the latest releases (since #20519). Regarding converting I don't think converting |
Yes, we noticed in Micrometer when it broke our integration tests: micrometer-metrics/micrometer#3796.
I think this is tying things together that shouldn't be tied together. OTLP is a format for telemetry data; it defines the data model but not the semantic naming. Someone should not have to use the OTel semantic convention to successfully use OTLP or the OTel Collector. I understand all of these things are branded OpenTelemetry, but it would behoove adoption and usefulness to users if they could be used separately. And it was my understanding they were intended to be usable without using everything. It hurts the Collector's general usefulness if the Prometheus exporter expects the input is already in seconds so it matches data produced specifically for Prometheus/OpenMetrics. If the producer is a Prometheus client, it's clear what conventions it should follow as far as unit, but not all producers know where data they are producing will be stored, especially if it is in OTLP format (and sent to the Collector) that is supported by different backends.
That's unfortunate and I don't have any solution. It feels like it leaves us in this bad state where the Collector can't deliver its full potential of being a universal adapter. Users are going to have to make more breaking changes to align with its limitations. |
Fyi: it seems that starting from |
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 Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@Aneurysm9 Could you please add the |
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 Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@Aneurysm9 or someone else: Could you please add the never stale label on the issue so that I don't need to play ping-pong with the bot? |
Component(s)
exporter/prometheus
What happened?
Description
Prometheus uses seconds as time unit by default. If I send an OTLP histogram with a different time unit, the value will not be converted to seconds (as it should be) but will be used as-is.
Steps to Reproduce
Send a histogram with unit: "milliseconds" to the OTel collector where the receiver is
otlp/http/protobuf
(but I think any otlp receiver should produce the same result) and the exporter is prometheus. Then check the Prometheus/metrics
endpoint.E.g.:
Expected Result
Actual Result
Collector version
otel/opentelemetry-collector-contrib:cdf47846a7ff
Environment information
Environment
OS: MacOS 13.2.1
OpenTelemetry Collector configuration
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: