You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
instrumented http module with @opentelemetry/plugin-http. then called http.get(url, options, cb) with invalid header which caused the function to throw an exception.
If possible, provide a recipe for reproducing the error.
import{NodeTracerProvider}from"@opentelemetry/node";import{SimpleSpanProcessor}from'@opentelemetry/tracing';import{JaegerExporter}from'@opentelemetry/exporter-jaeger';constprovider=newNodeTracerProvider({logger: console});constexporter=newJaegerExporter({logger: console,serviceName: 'http-out-debug'});provider.addSpanProcessor(newSimpleSpanProcessor(exporter));provider.register();import*ashttpfrom'http';http.get('http://www.google.com',{headers: {cookie: undefined,// <============ this make http.get throw}},(res)=>{res.setEncoding('utf8');letrawData='';res.on('data',(chunk)=>{rawData+=chunk;});res.on('end',()=>{console.log('got back data');});});
What did you expect to see?
Http span with error, and relevant attributes (at least http.url).
What did you see instead?
Http span with error, but http.url and other request attributes missing in the span.
Span{attributes: {component: 'http','http.error_name': 'TypeError','http.error_message': 'Invalid value "undefined" for header "cookie"'},links: [],events: [],status: {code: 2,message: 'Invalid value "undefined" for header "cookie"'},endTime: [1593439010,94328504],_ended: true,_duration: [0,3152474],name: 'GET /',spanContext: {traceId: '414aa171b3c5cd00539a0d86ea7ab5b8',spanId: '6b1e1761ee041018',traceFlags: 1,traceState: undefined},parentSpanId: undefined,kind: 2,startTime: [1593439010,91176030],resource: Resource{labels: {'telemetry.sdk.language': 'nodejs','telemetry.sdk.name': 'opentelemetry','telemetry.sdk.version': '0.9.0'}}}
Additional context
When there are a lot of requests, and some requests fails due to bad header, the trace is missing important attributes which can be used to debug the issue (like http.url)
This is because getOutgoingRequestAttributes is called after the original patched function call.
I suggest to move getOutgoingRequestAttributes before original.apply, so span will contain url and other attributes if original.apply throw.
The text was updated successfully, but these errors were encountered:
What version of OpenTelemetry are you using?
v0.9.0
What version of Node are you using?
v13.11.0
What did you do?
instrumented http module with @opentelemetry/plugin-http. then called http.get(url, options, cb) with invalid header which caused the function to throw an exception.
If possible, provide a recipe for reproducing the error.
What did you expect to see?
Http span with error, and relevant attributes (at least
http.url
).What did you see instead?
Http span with error, but
http.url
and other request attributes missing in the span.Additional context
When there are a lot of requests, and some requests fails due to bad header, the trace is missing important attributes which can be used to debug the issue (like
http.url
)This is because
getOutgoingRequestAttributes
is called after the original patched function call.I suggest to move
getOutgoingRequestAttributes
beforeoriginal.apply
, so span will contain url and other attributes iforiginal.apply
throw.The text was updated successfully, but these errors were encountered: