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
I'm testing OpenTelemetry with RxJS, which is used in Angular, NestJS for which instrumentations already exist
I'm also using auto-instrumentations-node
The fact is context doesn't seem to be propagated, maybe I'm missing something?
It works if I inject manually the context
Here is a test script to reproduce:
import{trace,context}from'@opentelemetry/api';import{of,tap}from'rxjs';consttracer=trace.getTracer('example');constlogContext=(message: string)=>console.log(message,context.active());constob=tracer.startActiveSpan('my-lib',()=>{constctx=context.active();// Context is the expected one, corresponding to 'my-lib' active spanlogContext('Before observable');returnof(1).pipe(// Context is BASE_CONTEXT, not the expected onetap(()=>logContext('In pipeline, but without context provided')),// Context is the expected one, corresponding to 'my-lib' active spantap(()=>context.with(ctx,logContext,undefined,'In pipeline, with context provided')));});ob.subscribe();
The first tap operator won't benefit from the active context
the second one will benefit from it, because context is injected with context.with
Is there a smarter way to achieve this, more automatically?
This issue may affect other languages where Rx is also available RxJava, RxGo, etc..
This only affects the JavaScript OpenTelemetry library
This may affect other libraries, but I would like to get opinions here first
The text was updated successfully, but these errors were encountered:
Hello,
I'm testing OpenTelemetry with RxJS, which is used in Angular, NestJS for which instrumentations already exist
I'm also using
auto-instrumentations-node
The fact is context doesn't seem to be propagated, maybe I'm missing something?
It works if I inject manually the context
Here is a test script to reproduce:
tap
operator won't benefit from the active contextcontext.with
Is there a smarter way to achieve this, more automatically?
This issue may affect other languages where Rx is also available RxJava, RxGo, etc..
The text was updated successfully, but these errors were encountered: