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

Add test for honor_labels configuration for Prometheus Receiver #5995

Closed
mustafain117 opened this issue Oct 29, 2021 · 1 comment · Fixed by #6369
Closed

Add test for honor_labels configuration for Prometheus Receiver #5995

mustafain117 opened this issue Oct 29, 2021 · 1 comment · Fixed by #6369
Labels
ci-cd CI, CD, testing, build issues comp:prometheus Prometheus related issues comp: receiver Receiver

Comments

@mustafain117
Copy link
Contributor

mustafain117 commented Oct 29, 2021

Is your feature request related to a problem? Please describe.
We want to ensure that the Prometheus receiver handles label conflicts based on the honor_labels value set in the scrape config.

Describe the solution you'd like

We propose the following solution:
To test if the Prometheus receiver handles honor labels configuration, we can configure the receiver to scrape data with existing job and instance labels and validate the output from the receiver.

For the first test case, we set honor_labels : true.

Expected Result: Here we expect the Prometheus receiver to resolve label conflicts for the job and instance labels by keeping the values from the scraped data.

For the second test case, we set honor_labels : false.

Expected Result: In this case we expect the receiver to rename the conflicting job and instance labels from the scraped data to “exported_instance”=<original_value> and “exported_job”=<original_value>".

Test data with existing job and instance labels:

# HELP test_gauge0 This is my gauge
# TYPE test_gauge0 gauge
test_gauge0{instance="test:8080",job="test-job",label1="testvalue1"} 0.9309611399533153

Describe alternatives you've considered
N/A
Additional context
Related to : open-telemetry/wg-prometheus#57

CC: @alolita @Aneurysm9

@mustafain117 mustafain117 changed the title Add test for Prometheus honor_labels configuration for Prometheus Receiver Add test for honor_labels configuration for Prometheus Receiver Oct 29, 2021
@alolita alolita added comp:prometheus Prometheus related issues ci-cd CI, CD, testing, build issues comp: receiver Receiver labels Nov 2, 2021
@mustafain117
Copy link
Contributor Author

@alolita please assign this issue to me.

povilasv referenced this issue in coralogix/opentelemetry-collector-contrib Dec 19, 2022
Signed-off-by: Bogdan <bogdandrutu@gmail.com>

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
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
Projects
None yet
2 participants