open-telemetry / opentelemetry-dotnet

The OpenTelemetry .NET Client
https://opentelemetry.io
Apache License 2.0
3.12k stars 745 forks source link

Ability to disable timestamps at the end of a metric #5485

Open ezhdn opened 4 months ago

ezhdn commented 4 months ago

I saw that when using exporter for Prometheus at the end of the metric exists timestampt, as example

# HELP process_memory_usage_bytes The amount of physical memory allocated for this process.
process_memory_usage_bytes 262610944 1711610959090

Is there any possibility to disable output of this timestamp?

As i inderstood there this related to - https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#tracking-when-metrics-last-changed

ledouxpl commented 2 months ago

Just chiming in to say that I would like this option as well.

In fact, my prometheus instance is continually logging "Error on ingesting samples that are too old or are too far into the future" when scraping metrics. It appears the open telemetry Prometheus Exporter is writing timestamps expressed in milliseconds where Prometheus expects them to be in seconds.

Don't know if this is intentional or not. If it is, it would also be nice to be able to configure the timestamp's unit.

jeremyliuu commented 1 month ago

+1