@@ -64,7 +64,7 @@ void gettersAndSetters() {
6464 DDSpan span =
6565 (DDSpan )
6666 tracer
67- .buildSpan ("fakeOperation" )
67+ .buildSpan ("datadog" , " fakeOperation" )
6868 .withServiceName ("fakeService" )
6969 .withResourceName ("fakeResource" )
7070 .withSpanType ("fakeType" )
@@ -96,7 +96,7 @@ void gettersAndSetters() {
9696 @ Test
9797 void resourceNameEqualsOperationNameIfNull () {
9898 String opName = "operationName" ;
99- DDSpan span = (DDSpan ) tracer .buildSpan (opName ).start ();
99+ DDSpan span = (DDSpan ) tracer .buildSpan ("datadog" , opName ).start ();
100100 assertEquals (opName , span .getResourceName ().toString ());
101101 assertFalse (span .getServiceName ().isEmpty ());
102102
@@ -105,7 +105,7 @@ void resourceNameEqualsOperationNameIfNull() {
105105 span =
106106 (DDSpan )
107107 tracer
108- .buildSpan (opName )
108+ .buildSpan ("datadog" , opName )
109109 .withResourceName (resourceName )
110110 .withServiceName (serviceName )
111111 .start ();
@@ -117,7 +117,7 @@ void resourceNameEqualsOperationNameIfNull() {
117117 void durationMeasuredInNanoseconds () {
118118 long mod = TimeUnit .MILLISECONDS .toNanos (1 );
119119 long start = System .nanoTime ();
120- DDSpan span = (DDSpan ) tracer .buildSpan ("test" ).start ();
120+ DDSpan span = (DDSpan ) tracer .buildSpan ("datadog" , " test" ).start ();
121121 long between = System .nanoTime ();
122122 long betweenDur = System .nanoTime () - between ;
123123 span .finish ();
@@ -138,7 +138,7 @@ void durationMeasuredInNanoseconds() {
138138 void phasedFinishCapturesDurationButDoesNotPublishImmediately () throws Exception {
139139 long mod = TimeUnit .MILLISECONDS .toNanos (1 );
140140 long start = System .nanoTime ();
141- DDSpan span = (DDSpan ) tracer .buildSpan ("test" ).start ();
141+ DDSpan span = (DDSpan ) tracer .buildSpan ("datadog" , " test" ).start ();
142142 long between = System .nanoTime ();
143143 long betweenDur = System .nanoTime () - between ;
144144 // calling publish before phasedFinish
@@ -196,7 +196,7 @@ void startingWithTimestampDisablesNanotime() {
196196 DDSpan span =
197197 (DDSpan )
198198 tracer
199- .buildSpan ("test" )
199+ .buildSpan ("datadog" , " test" )
200200 .withStartTimestamp (TimeUnit .MILLISECONDS .toMicros (System .currentTimeMillis ()))
201201 .start ();
202202 long between = System .currentTimeMillis ();
@@ -219,7 +219,7 @@ void startingWithTimestampDisablesNanotime() {
219219 void stoppingWithTimestampDisablesNanotime () {
220220 long mod = TimeUnit .MILLISECONDS .toNanos (1 );
221221 long start = System .currentTimeMillis ();
222- DDSpan span = (DDSpan ) tracer .buildSpan ("test" ).start ();
222+ DDSpan span = (DDSpan ) tracer .buildSpan ("datadog" , " test" ).start ();
223223 long between = System .currentTimeMillis ();
224224 long betweenDur = System .currentTimeMillis () - between ;
225225 span .finish (TimeUnit .MILLISECONDS .toMicros (System .currentTimeMillis () + 1 ));
@@ -239,7 +239,7 @@ void stoppingWithTimestampDisablesNanotime() {
239239
240240 @ Test
241241 void stoppingWithTimestampBeforeStartTimeYieldsMinDurationOfOne () {
242- DDSpan span = (DDSpan ) tracer .buildSpan ("test" ).start ();
242+ DDSpan span = (DDSpan ) tracer .buildSpan ("datadog" , " test" ).start ();
243243 // remove tick precision part of our internal time to match previous test condition
244244 span .finish (
245245 TimeUnit .MILLISECONDS .toMicros (TimeUnit .NANOSECONDS .toMillis (span .getStartTimeNano ()))
@@ -249,14 +249,16 @@ void stoppingWithTimestampBeforeStartTimeYieldsMinDurationOfOne() {
249249
250250 @ Test
251251 void prioritySamplingMetricSetOnlyOnRootSpan () {
252- DDSpan parent = (DDSpan ) tracer .buildSpan ("testParent" ).start ();
253- DDSpan child1 = (DDSpan ) tracer .buildSpan ("testChild1" ).asChildOf (parent .context ()).start ();
252+ DDSpan parent = (DDSpan ) tracer .buildSpan ("datadog" , "testParent" ).start ();
253+ DDSpan child1 =
254+ (DDSpan ) tracer .buildSpan ("datadog" , "testChild1" ).asChildOf (parent .context ()).start ();
254255
255256 child1 .setSamplingPriority (PrioritySampling .SAMPLER_KEEP );
256257 child1 .context ().lockSamplingPriority ();
257258 parent .setSamplingPriority (PrioritySampling .SAMPLER_DROP );
258259 child1 .finish ();
259- DDSpan child2 = (DDSpan ) tracer .buildSpan ("testChild2" ).asChildOf (parent .context ()).start ();
260+ DDSpan child2 =
261+ (DDSpan ) tracer .buildSpan ("datadog" , "testChild2" ).asChildOf (parent .context ()).start ();
260262 child2 .finish ();
261263 parent .finish ();
262264
@@ -289,9 +291,10 @@ void originSetOnlyOnRootSpan(String scenario, AgentSpanContext extractedContext)
289291 throws Exception {
290292 DDSpanContext parent =
291293 (DDSpanContext )
292- tracer .buildSpan ("testParent" ).asChildOf (extractedContext ).start ().context ();
294+ tracer .buildSpan ("datadog" , " testParent" ).asChildOf (extractedContext ).start ().context ();
293295 DDSpanContext child =
294- (DDSpanContext ) tracer .buildSpan ("testChild1" ).asChildOf (parent ).start ().context ();
296+ (DDSpanContext )
297+ tracer .buildSpan ("datadog" , "testChild1" ).asChildOf (parent ).start ().context ();
295298
296299 assertEquals ("some-origin" , parent .getOrigin ().toString ());
297300 // Access field directly instead of getter.
@@ -322,8 +325,8 @@ static Stream<Arguments> isRootSpanArguments() {
322325 @ MethodSource ("isRootSpanArguments" )
323326 void isRootSpanInAndNotInContextOfDistributedTracing (
324327 String scenario , AgentSpanContext extractedContext , boolean isTraceRootSpan ) {
325- DDSpan root = (DDSpan ) tracer .buildSpan ("root" ).asChildOf (extractedContext ).start ();
326- DDSpan child = (DDSpan ) tracer .buildSpan ("child" ).asChildOf (root .context ()).start ();
328+ DDSpan root = (DDSpan ) tracer .buildSpan ("datadog" , " root" ).asChildOf (extractedContext ).start ();
329+ DDSpan child = (DDSpan ) tracer .buildSpan ("datadog" , " child" ).asChildOf (root .context ()).start ();
327330
328331 assertEquals (isTraceRootSpan , root .isRootSpan ());
329332 assertFalse (child .isRootSpan ());
@@ -350,8 +353,8 @@ static Stream<Arguments> getApplicationRootSpanArguments() {
350353 @ MethodSource ("getApplicationRootSpanArguments" )
351354 void getApplicationRootSpanInAndNotInContextOfDistributedTracing (
352355 String scenario , AgentSpanContext extractedContext ) {
353- DDSpan root = (DDSpan ) tracer .buildSpan ("root" ).asChildOf (extractedContext ).start ();
354- DDSpan child = (DDSpan ) tracer .buildSpan ("child" ).asChildOf (root .context ()).start ();
356+ DDSpan root = (DDSpan ) tracer .buildSpan ("datadog" , " root" ).asChildOf (extractedContext ).start ();
357+ DDSpan child = (DDSpan ) tracer .buildSpan ("datadog" , " child" ).asChildOf (root .context ()).start ();
355358
356359 assertEquals (root , root .getLocalRootSpan ());
357360 assertEquals (root , child .getLocalRootSpan ());
@@ -367,8 +370,8 @@ void getApplicationRootSpanInAndNotInContextOfDistributedTracing(
367370 void publishingOfRootSpanClosesRequestContextData () throws Exception {
368371 Closeable reqContextData = mock (Closeable .class );
369372 TagContext context = new TagContext ().withRequestContextDataAppSec (reqContextData );
370- DDSpan root = (DDSpan ) tracer .buildSpan ("root" ).asChildOf (context ).start ();
371- DDSpan child = (DDSpan ) tracer .buildSpan ("child" ).asChildOf (root .context ()).start ();
373+ DDSpan root = (DDSpan ) tracer .buildSpan ("datadog" , " root" ).asChildOf (context ).start ();
374+ DDSpan child = (DDSpan ) tracer .buildSpan ("datadog" , " child" ).asChildOf (root .context ()).start ();
372375
373376 assertEquals (reqContextData , root .getRequestContext ().getData (RequestContextSlot .APPSEC ));
374377 assertEquals (reqContextData , child .getRequestContext ().getData (RequestContextSlot .APPSEC ));
@@ -420,7 +423,7 @@ void inferTopLevelFromParentServiceName(
420423
421424 @ Test
422425 void brokenPipeExceptionDoesNotCreateErrorSpan () {
423- DDSpan span = (DDSpan ) tracer .buildSpan ("root" ).start ();
426+ DDSpan span = (DDSpan ) tracer .buildSpan ("datadog" , " root" ).start ();
424427 span .addThrowable (new IOException ("Broken pipe" ));
425428 assertFalse (span .isError ());
426429 assertNull (span .getTag (DDTags .ERROR_STACK ));
@@ -429,7 +432,7 @@ void brokenPipeExceptionDoesNotCreateErrorSpan() {
429432
430433 @ Test
431434 void wrappedBrokenPipeExceptionDoesNotCreateErrorSpan () {
432- DDSpan span = (DDSpan ) tracer .buildSpan ("root" ).start ();
435+ DDSpan span = (DDSpan ) tracer .buildSpan ("datadog" , " root" ).start ();
433436 span .addThrowable (new RuntimeException (new IOException ("Broken pipe" )));
434437 assertFalse (span .isError ());
435438 assertNull (span .getTag (DDTags .ERROR_STACK ));
@@ -438,7 +441,7 @@ void wrappedBrokenPipeExceptionDoesNotCreateErrorSpan() {
438441
439442 @ Test
440443 void nullExceptionSafeToAdd () {
441- DDSpan span = (DDSpan ) tracer .buildSpan ("root" ).start ();
444+ DDSpan span = (DDSpan ) tracer .buildSpan ("datadog" , " root" ).start ();
442445 span .addThrowable (null );
443446 assertFalse (span .isError ());
444447 assertNull (span .getTag (DDTags .ERROR_STACK ));
@@ -451,7 +454,7 @@ void nullExceptionSafeToAdd() {
451454 "rate=0.25 no lim | 0.25 | 2147483647"
452455 })
453456 void setSingleSpanSamplingTags (String scenario , double rate , int limit ) {
454- DDSpan span = (DDSpan ) tracer .buildSpan ("testSpan" ).start ();
457+ DDSpan span = (DDSpan ) tracer .buildSpan ("datadog" , " testSpan" ).start ();
455458 assertEquals (UNSET , span .samplingPriority ());
456459
457460 span .setSpanSamplingPriority (rate , limit );
@@ -467,7 +470,7 @@ void setSingleSpanSamplingTags(String scenario, double rate, int limit) {
467470
468471 @ Test
469472 void errorPrioritiesShouldBeRespected () {
470- DDSpan span = (DDSpan ) tracer .buildSpan ("testSpan" ).start ();
473+ DDSpan span = (DDSpan ) tracer .buildSpan ("datadog" , " testSpan" ).start ();
471474 assertFalse (span .isError ());
472475
473476 span .setError (true );
0 commit comments