@@ -23,16 +23,13 @@ import {
2323 TextMapPropagator ,
2424 TextMapSetter ,
2525} from '../context/propagation/TextMapPropagator' ;
26- import { ContextAPI } from './context' ;
2726import {
2827 API_BACKWARDS_COMPATIBILITY_VERSION ,
2928 GLOBAL_PROPAGATION_API_KEY ,
3029 makeGetter ,
3130 _global ,
3231} from './global-utils' ;
3332
34- const contextApi = ContextAPI . getInstance ( ) ;
35-
3633/**
3734 * Singleton object which represents the entry point to the OpenTelemetry Propagation API
3835 */
@@ -72,29 +69,29 @@ export class PropagationAPI {
7269 /**
7370 * Inject context into a carrier to be propagated inter-process
7471 *
72+ * @param context Context carrying tracing data to inject
7573 * @param carrier carrier to inject context into
7674 * @param setter Function used to set values on the carrier
77- * @param context Context carrying tracing data to inject. Defaults to the currently active context.
7875 */
7976 public inject < Carrier > (
77+ context : Context ,
8078 carrier : Carrier ,
81- setter : TextMapSetter < Carrier > = defaultTextMapSetter ,
82- context : Context = contextApi . active ( )
79+ setter : TextMapSetter < Carrier > = defaultTextMapSetter
8380 ) : void {
8481 return this . _getGlobalPropagator ( ) . inject ( context , carrier , setter ) ;
8582 }
8683
8784 /**
8885 * Extract context from a carrier
8986 *
87+ * @param context Context which the newly created context will inherit from
9088 * @param carrier Carrier to extract context from
9189 * @param getter Function used to extract keys from a carrier
92- * @param context Context which the newly created context will inherit from. Defaults to the currently active context.
9390 */
9491 public extract < Carrier > (
92+ context : Context ,
9593 carrier : Carrier ,
96- getter : TextMapGetter < Carrier > = defaultTextMapGetter ,
97- context : Context = contextApi . active ( )
94+ getter : TextMapGetter < Carrier > = defaultTextMapGetter
9895 ) : Context {
9996 return this . _getGlobalPropagator ( ) . extract ( context , carrier , getter ) ;
10097 }
0 commit comments