-
Notifications
You must be signed in to change notification settings - Fork 2.8k
exporter/datadog: Issue 1684 fix, update status code handling #1691
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1691 +/- ##
==========================================
- Coverage 89.41% 89.40% -0.01%
==========================================
Files 370 370
Lines 18141 18150 +9
==========================================
+ Hits 16220 16227 +7
- Misses 1431 1433 +2
Partials 490 490
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
status: http.StatusInternalServerError, | ||
} | ||
if status := s.Status(); !status.IsNil() { | ||
isError := 0 |
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.
Why not use a boolean value for isError
?
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.
datadog Span.Error
has to be a 32bit int of either 1/0, so i tried to combine some things here. I've updated this to use constants so that it's a bit easier to read and the if statements are cleaner
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.
LGTM! we could add test cases for the StatusCodeOk
and StatusCodeUnset
situations too to ensure that no error is reported in those cases.
@owais lmk if any questions, this should be good to go i believe |
Description:
This PR addresses the status code handling issue described in this open issue: #1684
There were recently some changes made to Span Status Code, and while otel-collector-contrib exporters were updated to reflect those changes here #1489, the datadog exporter was not included as it was only recently added to the repository. This PR brings the datadog exporter up to date with how Span Status Code's are handled by Otel and generally simplifies the logic of setting a DatadogSpan
error
.Link to tracking Issue: #1684
Testing: Beside updating the unit tests, I reproduced the issue highlighted in #1684 using the latest otel-collector-contrib and opentelemetry-go, and then confirmed that the above change resolves the issue.