Remap http.response.status_code to http.status_code for otel spans#4384
Remap http.response.status_code to http.status_code for otel spans#4384zarirhamza merged 3 commits intomasterfrom
http.response.status_code to http.status_code for otel spans#4384Conversation
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. |
tlhunter
left a comment
There was a problem hiding this comment.
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_codehttp.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_codetohttp.status_codeMotivation
To make otel spans compliant with trace metrics