-
Notifications
You must be signed in to change notification settings - Fork 39
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
fix!(sumologicexporter): send resource attributes as fields for non-otlp, removing metadata_attributes #549
Conversation
5228e9f
to
82925a3
Compare
53c119d
to
2c97487
Compare
2c97487
to
726bdaa
Compare
assert.Equal(t, "host.name=harry-potter, host.type=wizard", req.Header.Get("X-Sumo-Fields"), "X-Sumo-Fields") | ||
assert.Equal(t, "harry-potter", req.Header.Get("X-Sumo-Category"), "X-Sumo-Category") | ||
assert.Equal(t, "undefined", req.Header.Get("X-Sumo-Host"), "X-Sumo-Host") |
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'm not sure if we need the third argument, if yes, we should use it for all comparisons in tests 🤷
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.
The point of this is that we'll get this third argument in test failure output without the need to look at the code/line number.
I agree but at the same time I didn't want to change ALL TEST THE CODE. Perhaps an improvement for another time?
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.
The point of this is that we'll get this third argument in test failure output without the need to look at the code/line number.
Most of times I need to do it anyway 😅
errs []error | ||
droppedRecords []metricPair | ||
currentRecords []metricPair | ||
droppedRecords []pdata.Metric |
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.
what about resource attributes?
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.
We're sending metrics from a particular resource (see the argument to this func: pdata.ResourceMetrics
) so no need to set its attributes aside because we'll have it readily available at the call site.
sumologic-otel-collector/pkg/exporter/sumologicexporter/exporter.go
Lines 334 to 337 in 726bdaa
dropped = append(dropped, droppedResourceMetrics{ | |
resource: rm.Resource(), | |
metrics: droppedMetrics, | |
}) |
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 don't see a code where we translate record attributes. Do we decided to skip translation for them?
Yes, we decided to skip translation for 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.
The changes look ok to me. I'm just wandering if we should add documentation regarding the breaking change in this PR (in the changelog?) or leave it for the release notes? I'd rather do it here to be honest.
1ce53ab
to
9a6919d
Compare
9a6919d
to
20f6ebf
Compare
…ing metadata_attributes for text and json logs
4f87878
to
fbab92c
Compare
Co-authored-by: Dominik Rosiek <[email protected]>
8c2d22c
to
013aff7
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.
Let's ship it
No description provided.