open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.1k stars 2.39k forks source link

prometheusreceiver: Make use of created timestamp from prometheus #36473

Open dashpole opened 1 day ago

dashpole commented 1 day ago

Component(s)

receiver/prometheus

Describe the issue you're reporting

Prometheus now parses the timestamp for us: https://github.com/prometheus/prometheus/pull/14356. We need to implement the CreatedTimestampAppender interface (with the AppendCTZeroSample method and AppendHistogramCTZeroSample methods) to get access to it.

We also need to set EnableCreatedTimestampZeroIngestion to true in the scrape manager for the AppendCT* methods to be called.

We should remove the receiver.prometheusreceiver.UseCreatedMetric feature gate, and associated code after this is complete.

cc @open-telemetry/wg-prometheus

dashpole commented 1 day ago

cc @ridwanmsharif since you are also interested in created timestamp support