Skip to content
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 Receiver] Add test to validate Honor timestamps configuration #6085

Closed
PaurushGarg opened this issue Nov 1, 2021 · 2 comments
Closed
Assignees
Labels
ci-cd CI, CD, testing, build issues comp:prometheus Prometheus related issues comp: receiver Receiver Stale

Comments

@PaurushGarg
Copy link
Member

PaurushGarg commented Nov 1, 2021

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” inside scrape_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. If honor_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:

  • Set honor_timestamps : true inside scrape_configs of Prometheus Receiver configuration.
  • Provide timestamps with the metric in the testdata.
    For Example:
const honorTimestampsPage1 = `
# HELP go_threads Number of OS threads created
# TYPE go_thread gauge
go_threads 19 1634616931195
#EOF`
  • Validate that the honor_timestamps were handled and the start_timestamp present in the transformed OTLP data by the Prometheus Receiver contains the same input timestamp given in the testdata.

TestCase 2:

  • Set honor_timestamps : false inside scrape_configs of Prometheus Receiver configuration.
  • Provide timestamps with the metric in the testdata.
    For Example:
const honorTimestampsPage1 = `
# HELP go_threads Number of OS threads created
# TYPE go_thread gauge
go_threads 19 1634616931195
#EOF`
  • Validate that the honor_timestamps were handled and the start_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

@alolita alolita added comp:prometheus Prometheus related issues ci-cd CI, CD, testing, build issues comp: receiver Receiver labels Nov 2, 2021
@PaurushGarg
Copy link
Member Author

@alolita please assign this issue to me. I would like to work on this one.

@PaurushGarg PaurushGarg changed the title Add test to validate Honor timestamps configuration for the Prometheus Receiver [Prometheus Receiver] Add test to validate Honor timestamps configuration Nov 22, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2022

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 @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Nov 7, 2022
povilasv referenced this issue in coralogix/opentelemetry-collector-contrib Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-cd CI, CD, testing, build issues comp:prometheus Prometheus related issues comp: receiver Receiver Stale
Projects
None yet
Development

No branches or pull requests

3 participants