@@ -22,7 +22,7 @@ import {
22
22
NoopSpan ,
23
23
randomSpanId ,
24
24
randomTraceId ,
25
- INVALID_SPAN_CONTEXT ,
25
+ NOOP_SPAN ,
26
26
ALWAYS_SAMPLER ,
27
27
} from '@opentelemetry/core' ;
28
28
import { BasicTracerConfig } from '../src/types' ;
@@ -32,13 +32,11 @@ import { BinaryFormat, HttpTextFormat } from '@opentelemetry/types';
32
32
* This class represents a basic tracer.
33
33
*/
34
34
export class BasicTracer implements types . Tracer {
35
- static defaultSpan = new NoopSpan ( INVALID_SPAN_CONTEXT ) ;
36
-
37
- private _defaultAttributes : types . Attributes ;
38
- private _binaryFormat : types . BinaryFormat ;
39
- private _httpTextFormat : types . HttpTextFormat ;
40
- private _sampler : types . Sampler ;
41
- private _scopeManager : ScopeManager ;
35
+ private readonly _defaultAttributes : types . Attributes ;
36
+ private readonly _binaryFormat : types . BinaryFormat ;
37
+ private readonly _httpTextFormat : types . HttpTextFormat ;
38
+ private readonly _sampler : types . Sampler ;
39
+ private readonly _scopeManager : ScopeManager ;
42
40
43
41
/**
44
42
* Constructs a new Tracer instance.
@@ -74,7 +72,7 @@ export class BasicTracer implements types.Tracer {
74
72
if ( ! this . _sampler . shouldSample ( parentSpanContext ) ) {
75
73
// TODO: propagate SpanContext, for more information see
76
74
// https://github.com/open-telemetry/opentelemetry-js/pull/99#issuecomment-513325536
77
- return BasicTracer . defaultSpan ;
75
+ return NOOP_SPAN ;
78
76
}
79
77
80
78
// span context
0 commit comments