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 tests for honor_labels configuration #6369
Add Prometheus Receiver tests for honor_labels configuration #6369
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase @mustafain117
@codeboten Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look good to me, pinging @Aneurysm9 as a codeowner for a review.
func verifyHonorLabelsTrue(t *testing.T, td *testData, rms []*pdata.ResourceMetrics) { | ||
//Test for honor_labels: true is skipped. Currently, the Prometheus receiver is unable to support this config | ||
//See: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/5757 | ||
t.Skip("skipping test for honor_labels true configuration") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skipped tests tend to drift in my experience. I'd prefer to omit the tests, and leave a TODO with a link to the issue to add them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we've got an implementation that should work if the appender were able to handle this case I'd like to get this into the history so we can easily resurrect it. Because we squash PRs to a single commit that means that we'd need to land this and then remove it in a subsequent PR. I'm fine with leaving it in with a skip but we can follow up to remove this if you think it needs to go.
…lemetry#6369) * refactor existing external labels test * Add test for label_limit configuration * shutdown mock prometheus http test server within testHelper * fix spelling * fix lint error * rename testHelper to testMetricsReceiver * fix: lint issue in metrics_receiver_helper_test.go * Add Prometheus receiver test for honor_labels configuration * update TestHonorLabelsFalseConfig to use testComponent
Description:
This PR depends on #6150, the latest commit in this PR is relevant to the honor_labels configuration test
Adds
TestHonorLabelsFalseConfig
to testhonor_labels : false
configurationAdds
TestHonorLabelsTrueConfig
to testhonor_labels : true
configurationDetails:
Both tests use the following test data:
TestHonorLabelsFalseConfig
:Sets
honor_labels : false
for the scrape configurationValidates that the label conflicts are resolved by prefixing job and instance labels with "exported_" for the
test_gauge0
metricTestHonorLabelsTrueConfig
:Sets
honor_labels : true
for the scrape configurationValidates that the label conflicts are resolved by keeping job and instance label values from the scraped data
Link to tracking Issue:
Closes #5995