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
Now that we introduced global context and propagation APIs, the user is required to initialize the tracer provider, the context manager, and the propagator before they can begin tracing. We should simplify this process with sane platform-specific defaults in some simple way. Possibly we should export some function from web and node packages like initializeGlobalDefaults or something?
The text was updated successfully, but these errors were encountered:
I asked in the spec SIG meeting how much freedom we have to do this, and the answer was that we can do basically whatever we deem appropriate as long as we don't violate spec or API. With that in mind, I think we should export some helper function from node and web packages that allows for global initialization easily.
I have some proposals for the way this may work:
Option 1
importsdkfrom"@opentelemetry/node";// configuration object is optional, and all of its properties are optional// Node tracer provider will be created and registered with apisdk.configure({contextManager: manager,// default for node is async hooks, web is zonepropagators: [traceContext,b3,correlation],// default is trace context});
Option 2
import{NodeTracerProvider}from"@opentelemetry/node";constprovider=newNodeTracerProvider(/* options are unchanged */);// configuration object is optional, and all of its properties are optionalprovider.register({contextManager: manager,// default for node is async hooks, web is zonepropagators: [traceContext,b3,correlation],// default is trace context})
Now that we introduced global
context
andpropagation
APIs, the user is required to initialize the tracer provider, the context manager, and the propagator before they can begin tracing. We should simplify this process with sane platform-specific defaults in some simple way. Possibly we should export some function fromweb
andnode
packages likeinitializeGlobalDefaults
or something?The text was updated successfully, but these errors were encountered: