Missing http_route attribute on the http_server_duration metric when traces export is disabled #3862
Labels
bug
Something isn't working
has:reproducer
This bug/feature has a minimal reproducer provided
pkg:sdk-node
priority:p2
Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
up-for-grabs
Good for taking. Extra help will be provided by maintainers
What happened?
Steps to Reproduce
Set up
NodeSDK
withHttpInstrumentation
,ExpressInstrumentation
andmetricReader
. Run app withOTEL_TRACES_EXPORTER: none
.Expected Result
http_route
attribute is present on thehttp_server_duration
metric.Actual Result
http_route
attribute is missing on thehttp_server_duration
metric.Additional Details
If
NodeSDK
is set up with sometraceExporter
e.g.ConsoleSpanExporter
thenhttp_route
attribute is present on thehttp_server_duration
metric.Sharing my investigation results - the
http_route
attribute is added to the metric attributes byHttpInstrumentation
from therpc metadata
which in turn is added to the propagationcontext
byExpressInstrumentation
only when tracing is enabled. Apparently at the moment there is no way to workaround it using instrumentation hooks as inside the hooks you have no means to manipulate the propagationcontext
.Also e.g.
OTel
Java
instrumentation addshttp_route
to thehttp_server_duration
metric even ifOTEL_TRACES_EXPORTER: none
.There is a feature request that could help to workaround this #3694 but ideally this bug should be fixed.
OpenTelemetry Setup Code
package.json
Relevant log output
No response
The text was updated successfully, but these errors were encountered: