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 Prometheus Receiver test to verify time series with empty label values are supported #6407

Merged

Conversation

mustafain117
Copy link
Contributor

Description:
This PR adds a test (TestEmptyLabelValues) to verify the Prometheus Receiver supports time series with empty label values.
According to Prometheus documentation, a label with an empty label value is considered equivalent to a label that does not exist.

The test validates the following two scenarios:
Case 1: Metric data with one time series with an empty label value:

# HELP test_gauge0 This is my gauge
# TYPE test_gauge0 gauge
test_gauge0{id="1",testLabel=""} 19

Expected Result: testLabel is dropped

Case 2: Metric data with two time series with the same metric name, one has a value for testLabel and the other has an empty label value for testLabel:

# HELP test_gauge0 This is my gauge.
# TYPE test_gauge0 gauge
test_gauge0{id="1",testLabel=""} 19
test_gauge0{id="2",testLabel="foobar"} 2

Expected Result:

  • testLabel is dropped for the first time series (test_gauge0{id="1",testLabel=""} 19)
  • testLabel has value foobar for the second time series (test_gauge0{id="2",testLabel="foobar"} 2)

Link to tracking Issue:
Closes #5996

@mustafain117
Copy link
Contributor Author

@dashpole @vishiy can you please provide a review for this PR? Thank you.

@alolita alolita added comp:prometheus Prometheus related issues ready to merge Code review completed; ready to merge by maintainers labels Nov 24, 2021
@alolita
Copy link
Member

alolita commented Nov 24, 2021

@bogdandrutu can you please merge? We are blocked on other PRs dependent on this one :-) Ty!

@codeboten codeboten merged commit dfa941e into open-telemetry:main Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:prometheus Prometheus related issues ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add test for Prometheus Receiver to verify timeseries with empty label values are supported
6 participants