opentelemetry-js
opentelemetry-js copied to clipboard
fix(instrumentation-http): report error.type metrics attribute
trafficstars
Which problem is this PR solving?
This reports the error.type attribute on HTTP metrics wherever it is already reported on HTTP spans.
Fixes #5627
Short description of the changes
Updates the metrics attributes from the _on***Error helpers and uses those wherever appropriate.
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
I added a test for client metrics but couldn't figure out a way to test server metrics since it involves throwing within the server request handler which is an uncaught exception.
Checklist:
- [x] Followed the style guidelines of this project
- [x] Unit tests have been added