@@ -14,7 +14,6 @@ const standalone = require('../../src/standalone')
1414const DatadogSpan = require ( '../../src/opentracing/span' )
1515
1616const {
17- APM_TRACING_ENABLED_KEY ,
1817 SAMPLING_MECHANISM_APPSEC ,
1918 DECISION_MAKER_KEY ,
2019 TRACE_SOURCE_PROPAGATION_KEY ,
@@ -24,7 +23,6 @@ const TextMapPropagator = require('../../src/opentracing/propagation/text_map')
2423const TraceState = require ( '../../src/opentracing/propagation/tracestate' )
2524const TraceSourcePrioritySampler = require ( '../../src/standalone/tracesource_priority_sampler' )
2625
27- const startCh = channel ( 'dd-trace:span:start' )
2826const extractCh = channel ( 'dd-trace:span:extract' )
2927
3028describe ( 'Disabled APM Tracing or Standalone' , ( ) => {
@@ -49,33 +47,26 @@ describe('Disabled APM Tracing or Standalone', () => {
4947 afterEach ( ( ) => { sinon . restore ( ) } )
5048
5149 describe ( 'configure' , ( ) => {
52- let startChSubscribe
53- let startChUnsubscribe
5450 let extractChSubscribe
5551 let extractChUnsubscribe
5652
5753 beforeEach ( ( ) => {
58- startChSubscribe = sinon . stub ( startCh , 'subscribe' )
59- startChUnsubscribe = sinon . stub ( startCh , 'unsubscribe' )
6054 extractChSubscribe = sinon . stub ( extractCh , 'subscribe' )
6155 extractChUnsubscribe = sinon . stub ( extractCh , 'unsubscribe' )
6256 } )
6357
64- it ( 'should subscribe to start span if apmTracing disabled' , ( ) => {
58+ it ( 'should subscribe to extract if apmTracing disabled' , ( ) => {
6559 standalone . configure ( config )
6660
67- sinon . assert . calledOnce ( startChSubscribe )
6861 sinon . assert . calledOnce ( extractChSubscribe )
6962 } )
7063
71- it ( 'should not subscribe to start span if apmTracing enabled' , ( ) => {
64+ it ( 'should not subscribe to extract if apmTracing enabled' , ( ) => {
7265 config . apmTracingEnabled = true
7366
7467 standalone . configure ( config )
7568
76- sinon . assert . notCalled ( startChSubscribe )
7769 sinon . assert . notCalled ( extractChSubscribe )
78- sinon . assert . notCalled ( startChUnsubscribe )
7970 sinon . assert . notCalled ( extractChUnsubscribe )
8071 } )
8172
@@ -120,66 +111,6 @@ describe('Disabled APM Tracing or Standalone', () => {
120111 } )
121112 } )
122113
123- describe ( 'onStartSpan' , ( ) => {
124- it ( 'should not add _dd.apm.enabled tag when standalone is disabled' , ( ) => {
125- config . apmTracingEnabled = true
126- standalone . configure ( config )
127-
128- const span = new DatadogSpan ( tracer , processor , prioritySampler , {
129- operationName : 'operation' ,
130- } )
131-
132- assert . ok ( ! span . context ( ) . hasTag ( APM_TRACING_ENABLED_KEY ) )
133- } )
134-
135- it ( 'should add _dd.apm.enabled tag when standalone is enabled' , ( ) => {
136- standalone . configure ( config )
137-
138- const span = new DatadogSpan ( tracer , processor , prioritySampler , {
139- operationName : 'operation' ,
140- } )
141-
142- assert . ok (
143- span . context ( ) . hasTag ( APM_TRACING_ENABLED_KEY ) ,
144- `Available keys: ${ inspect ( Object . keys ( span . context ( ) . getTags ( ) ) ) } `
145- )
146- } )
147-
148- it ( 'should not add _dd.apm.enabled tag in child spans with local parent' , ( ) => {
149- standalone . configure ( config )
150-
151- const parent = new DatadogSpan ( tracer , processor , prioritySampler , {
152- operationName : 'operation' ,
153- } )
154-
155- assert . strictEqual ( parent . context ( ) . getTag ( APM_TRACING_ENABLED_KEY ) , 0 )
156-
157- const child = new DatadogSpan ( tracer , processor , prioritySampler , {
158- operationName : 'operation' ,
159- parent,
160- } )
161-
162- assert . ok ( ! child . context ( ) . hasTag ( APM_TRACING_ENABLED_KEY ) )
163- } )
164-
165- it ( 'should add _dd.apm.enabled tag in child spans with remote parent' , ( ) => {
166- standalone . configure ( config )
167-
168- const parent = new DatadogSpan ( tracer , processor , prioritySampler , {
169- operationName : 'operation' ,
170- } )
171-
172- parent . _isRemote = true
173-
174- const child = new DatadogSpan ( tracer , processor , prioritySampler , {
175- operationName : 'operation' ,
176- parent,
177- } )
178-
179- assert . strictEqual ( child . context ( ) . getTag ( APM_TRACING_ENABLED_KEY ) , 0 )
180- } )
181- } )
182-
183114 describe ( 'onSpanExtract' , ( ) => {
184115 it ( 'should reset priority if _dd.p.ts not present' , ( ) => {
185116 standalone . configure ( config )
0 commit comments