[Prometheus Receiver] Add test to validate Honor timestamps configuration #6085
Labels
ci-cd
CI, CD, testing, build issues
comp:prometheus
Prometheus related issues
comp: receiver
Receiver
Stale
Is your feature request related to a problem? Please describe.
Add a new Prometheus Receiver test to ensure
honor_timestamps
configurations are honored.honor_timestamps
controls whether Prometheus respects the timestamps present in scraped data.The
honor_timestamps
is a boolean that can be set to “true” or “false” insidescrape_configs
of Prometheus Receiver configuration in OTEL collector configuration yaml file.[ honor_timestamps: <boolean> | default = true ]
If
honor_timestamps
is set to “true”, then the timestamps of the metrics exposed by the target will be used. Ifhonor_timestamps
is set to “false”, then the timestamps of the metrics exposed by the target will be ignored.Describe the solution you'd like
We propose the following solution:
To test if the Prometheus receiver handles
honor_timestamps
configuration, we can configure the Prometheus receiver to scrape testdata and validate the output from the Prometheus receiver.TestCase 1:
honor_timestamps : true
insidescrape_configs
of Prometheus Receiver configuration.For Example:
honor_timestamps
were handled and thestart_timestamp
present in the transformed OTLP data by the Prometheus Receiver contains the same input timestamp given in the testdata.TestCase 2:
honor_timestamps : false
insidescrape_configs
of Prometheus Receiver configuration.For Example:
honor_timestamps
were handled and thestart_timestamp
present in the transformed OTLP data by the Prometheus Receiver contains the scrape start time and not the input timestamp given in the testdata.Additional context
Related to open-telemetry/wg-prometheus#57
cc: @alolita @Aneurysm9
The text was updated successfully, but these errors were encountered: