-
Notifications
You must be signed in to change notification settings - Fork 312
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
Remap http.response.status_code
to http.status_code
for otel spans
#4384
Conversation
Overall package sizeSelf size: 6.62 MB Dependency sizes
🤖 This report was automatically generated by heaviest-objects-in-the-universe |
BenchmarksBenchmark execution time: 2024-06-07 15:25:27 Comparing candidate commit 5586d6f in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 258 metrics, 8 unstable metrics. |
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.
This change modifies a function that's a bit more "global" in usage. Specifically setAttribute
is used not just by HTTP but also by databases, queues, gRPC, etc.
Maintaining this list would be a little painful, too. Imagine if we had a dozen of them. Plus there's a small performance penalty for adding an if statement in a code hot path.
Instead I'd suggest looking directly at the source for writing HTTP related tags. Check out packages/datadog-plugin-http2/src/client.js
and grep for HTTP_STATUS_CODE
for a more "local" place to change the code.
http.response.status_code
to http.status_code
http.response.status_code
to http.status_code
for otel spans
I didn't realize this was for setting otel attributes, not our regular tags. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4384 +/- ##
===========================================
+ Coverage 69.19% 81.86% +12.67%
===========================================
Files 1 120 +119
Lines 198 4621 +4423
Branches 33 33
===========================================
+ Hits 137 3783 +3646
- Misses 61 838 +777 ☔ View full report in Codecov by Sentry. |
What does this PR do?
Remap
http.response.status_code
tohttp.status_code
Motivation
To make otel spans compliant with trace metrics