fix: report disabled otel request context#171
Conversation
metcoder95
left a comment
There was a problem hiding this comment.
This is sadly not the fix we should apply, the enabled flag will just state weather or not the otel instrumentation is enabled for the route or the application, not if the handler has been instrumented or not.
A suggestion here will be to add another flag that hints wether or not the handler has been instrumented.
e.g. instrumented
Hi metcoder, thanks for you review. I will look into it and see where we can solve this by introducing a new parameter or not. |
cd7e304 to
4a7792c
Compare
Signed-off-by: Jimmy li <jili449668@gmail.com>
4a7792c to
0354c24
Compare
how the request looks likestateDiagram-v2
[*] --> IncomingRequest
IncomingRequest --> GloballyDisabled: instrumentation.disable()
IncomingRequest --> RouteDisabled: config.otel = false
IncomingRequest --> IgnoredPath: ignorePaths matches
IncomingRequest --> Instrumented: normal request
GloballyDisabled --> RequestContext
RouteDisabled --> RequestContext
IgnoredPath --> RequestContext
Instrumented --> RequestContext
RequestContext --> [*]
GloballyDisabled: enabled = false
GloballyDisabled: instrumented = false
GloballyDisabled: span/context = null
RouteDisabled: enabled = false
RouteDisabled: instrumented = false
RouteDisabled: span/context = null
IgnoredPath: enabled = true
IgnoredPath: instrumented = false
IgnoredPath: span/context = null
Instrumented: enabled = true
Instrumented: instrumented = true
Instrumented: span/context = available
|
Mutation Test report |
Issue Link: #170
feat: expose instrumented request context state
Core change:
Checklist
npm run test && npm run benchmark --if-presentand the Code of conduct