opentelemetry-js
opentelemetry-js copied to clipboard
fix(instrumentation-http): add server attributes after they become available
trafficstars
Which problem is this PR solving?
While reviewing #5079 I noticed that we don't set http.route and http.response.status code in the server duration metrics, so this PR addresses a few problems:
- We did not add
http.routeto theSpanon "new" metrics - We add the
http.routeonly whenDUPLICATEemission is turned on because- we also didn't add it to the Span for "new" metrics
- but we did add it for the "old" metrics and the attribute name happens to match
- we never added the
http.response.statuscode, because - it is not yet determined when we add it (before the request is handled)
NOTE: skipping changelog because this is a bug in an unreleased feature
Supersedes #5079 Related to #5026
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
- [x] Added assertions to unit tests