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
The problem arises that under the covers these libraries mutate spanOptions inside a private createSpan helper:
/** * Creates a span using the tracer that was set by the user * @param methodName The name of the method for which the span is being created. * @param requestOptions The options for the underlying http request. This will be * updated to use the newly created span as the "parent" so that any new spans created * after this point gets the right parent. */privatecreateSpan(methodName: string,requestOptions?: RequestOptionsBase): Span{consttracer=TracerProxy.getTracer();constoptions=requestOptions||{};constspan=tracer.startSpan(methodName,options.spanOptions);if(tracer.pluginType!==SupportedPlugins.NOOP&&(options.spanOptions&&options.spanOptions.parent)){options.spanOptions={ ...options.spanOptions,parent: span};}returnspan;}}
The issue being that if a user does two operations with a re-used options bag (expecting reasonably that their options would not be mutated), the tracing graph will be incorrect:
The expectation is that the above operations would have the same parent root span, but currently the second createKey would be parented under the first.
The text was updated successfully, but these errors were encountered:
Describe the bug
Operations can take a manual tracing span like this
The problem arises that under the covers these libraries mutate spanOptions inside a private
createSpan
helper:The issue being that if a user does two operations with a re-used options bag (expecting reasonably that their options would not be mutated), the tracing graph will be incorrect:
The expectation is that the above operations would have the same parent root span, but currently the second createKey would be parented under the first.
The text was updated successfully, but these errors were encountered: