-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[exporter/tanzuobservability] Don't roll resource tags into metrics #8338
Conversation
dea7d22
to
dc92dec
Compare
Hello, build-and-test unit test is failing, but I don't think the failure is related to the changes I made in this PR. I think the errors below are coming from: prometheusremotewriteexporter, but this PR is for the exporter/tanzuobservabilityexporter. Maybe it is a flaky test?
|
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.
Travis, the code changes look good to me. The only comment I can add here is that we are missing unit testing. Are there any in-direct tests we have, which are covering the code changes?
dc92dec
to
71d8626
Compare
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.
Looks good - a few minor comments. Thank you!
781d63d
to
346993f
Compare
CHANGELOG.md changes very frequently, so I am constantly rebasing with main to resolve conflicts. Is it possible to review this this PR even though this copy of CHANGELOG.md may have conflicts? |
My build was all green before, but with my latest rebase to main, a load test is failing. The only files with conflicts during my rebase were CHANGELOG.md and go.sum. Could this test failure be unrelated to the changes made in this PR? |
c18ed08
to
7f0486e
Compare
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.
Left one comment, but we'll pair-program on the full review and submit the changes.
@@ -268,7 +270,7 @@ func TestGaugeConsumerMissingValue(t *testing.T) { | |||
} | |||
|
|||
func createMetricInfo(metric pdata.Metric) metricInfo { | |||
mi := metricInfo{Metric: metric, Source: "test_source"} | |||
mi := metricInfo{Metric: metric, Source: "test_source", SourceKey: "host.name"} |
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.
I think we should inline this helper so that it's easy to see the hard-coded string values that are later used as assertions in the test.
a9fd93d
to
3e5e916
Compare
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.
Looks good – thanks Travis!
Hello. My change has been approved internally, but I see that the load tests are failing. These changes to our tanzuobservability exporter involve changing our unit tests. Can unit tests such as our unit tests for the tanzuobservability exporter affect the load tests? It seems that the load tests are failing because too much RAM is being used. |
Also, it seems that go.sum go.mod and changelog.md files change often. Is it ok if I rebase once and for all after I have your approval? |
ce969a4
to
5ce27df
Compare
It looks like testing the deb package is failing, but I am not sure why. What is the best way to troubleshoot? It looks like the offending command is |
Can you rebase and fix the conflicts? I think the deb issue might also go away. |
5ce27df
to
324b316
Compare
@jpkrohling I rebased my PR to the latest version of main to resolve the conflicts. The debian file built, but now the load tests are failing. Could these failures be flaky? |
Use the resourcetotelemetry helper instead. This involves several steps: 1. attributesToTags() works like it did before. It simply concatenates multiple pdata.AttributeMap values into a single map[string]string 2. Add newAttributeMap() to convert a map[string]string into a pdata.AttributeMap. This way you can still concatenate a map[string]string and a pdata.AttributeMap together into a single map[string]string because the traces exporter still needs to do this. 3. Add getSource() function to get just the source from resource attributes. 4. Add replaceSourceTag() function which replaces "source" with "_source" in the tags. This way the traces exporter can still work like it did before. 5. Remove the Tags field from the metricInfo type so that it just has the metric and its source. We don't need to store the resource tags with metrics anymore. 6. Update all attributesToTags() calls in the metrics exporter so that they get just the metric tags. 7. Fix all metric exporter tests so that they no longer expect resource attributes in the metrics. 8. Remove the tests that check that tags names "source" get renamed to "_source" 9. Use the resourcetotelemetry helper.
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
324b316
to
b4eb53b
Compare
Yes, those are intermittent failures. I rebased this to account for v0.48.0 changes. |
Thank you @jpkrohling |
@jpkrohling Can this PR be merged? |
Looks like it has been affected by a flaky test. I just restarted the failed jobs, will merge on green. |
[exporter/tanzuobservability] Don't roll resource tags into metrics
Description:
Undo the rolling of resource tags into metrics. In the future we will rely on the resourcetotelemetry helper to do this for us.
Testing:
Unit tests. Run OTEL collector with resourcetotelemetry helper turned off (default). Run OTEL collector with resourcetotelemetry helper turned on.