-
Notifications
You must be signed in to change notification settings - Fork 440
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 should not set explicit timestamps #2316
Comments
This was seen on gRPC C++'s OTel plugin, but the pattern of usage is nothing out of the ordinary from what I understand. Reference - https://github.com/grpc/grpc/blob/62521a889fe134859aed7bdf4ea0730534f15d09/src/cpp/ext/otel/otel_plugin.cc#L170 A Meter with the name "grpc" was created, and a counter instrument with the name "grpc.client.attempt.started" was created out of it. The counter was incremented like so - https://github.com/grpc/grpc/blob/62521a889fe134859aed7bdf4ea0730534f15d09/src/cpp/ext/otel/otel_client_filter.cc#L122 |
Steps to reproduce
I saw second-hand that the prometheus exporter adds explicit timestamps, but don't have exact reproduction steps.
The last number on the right is the start timestamp.
What is the expected behavior?
Metrics should not have explicit timestamps set. From the OpenMetrics specification
What is the actual behavior?
Explicit timestamps are added to prometheus metrics.
opentelemetry-cpp/exporters/prometheus/src/exporter_utils.cc
Line 265 in 0563a71
Additional context
In prometheus, the scrape time is used as the timestamp. Explicit timestamps can limit some functionality, such as compatibility with the prometheus push gateway, so they are generally not recommended.
The text was updated successfully, but these errors were encountered: