opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

fix(instrumentation-http): report error.type metrics attribute

Open raphael-theriault-swi opened this issue 6 months ago • 1 comments
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

raphael-theriault-swi avatar May 05 '25 20:05 raphael-theriault-swi