Skip to content

Commit 6623f9a

Browse files
committed
resolve conflicts
1 parent 088102b commit 6623f9a

3 files changed

Lines changed: 50 additions & 44 deletions

File tree

dd-trace-core/src/test/java/datadog/trace/core/DDSpanContextTest.java

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void setup() {
7575
void nullValuesForTagsDeleteExistingTags(String name) throws Exception {
7676
AgentSpan span =
7777
tracer
78-
.buildSpan("fakeOperation")
78+
.buildSpan("datadog", "fakeOperation")
7979
.withServiceName("fakeService")
8080
.withResourceName("fakeResource")
8181
.withSpanType("fakeType")
@@ -120,7 +120,7 @@ void specialTagsSetCertainValues(String scenario, String name, String expected,
120120
throws Exception {
121121
AgentSpan span =
122122
tracer
123-
.buildSpan("fakeOperation")
123+
.buildSpan("datadog", "fakeOperation")
124124
.withServiceName("fakeService")
125125
.withResourceName("fakeResource")
126126
.withSpanType("fakeType")
@@ -165,7 +165,7 @@ static Object[][] tagsCanBeAddedToContextArguments() {
165165
void tagsCanBeAddedToContext(String name, Object value) throws Exception {
166166
AgentSpan span =
167167
tracer
168-
.buildSpan("fakeOperation")
168+
.buildSpan("datadog", "fakeOperation")
169169
.withServiceName("fakeService")
170170
.withResourceName("fakeResource")
171171
.withSpanType("fakeType")
@@ -202,7 +202,7 @@ void metricsUseExpectedTypes(Class<?> expectedType, Number value) {
202202
// floats should be converted to doubles.
203203
AgentSpan span =
204204
tracer
205-
.buildSpan("fakeOperation")
205+
.buildSpan("datadog", "fakeOperation")
206206
.withServiceName("fakeService")
207207
.withResourceName("fakeResource")
208208
.start();
@@ -219,7 +219,7 @@ void metricsUseExpectedTypes(Class<?> expectedType, Number value) {
219219
void forceKeepReallyKeepsTrace() {
220220
AgentSpan span =
221221
tracer
222-
.buildSpan("fakeOperation")
222+
.buildSpan("datadog", "fakeOperation")
223223
.withServiceName("fakeService")
224224
.withResourceName("fakeResource")
225225
.start();
@@ -251,11 +251,12 @@ void setTraceSegmentTagsAndDataOnCorrectSpan() {
251251
DATADOG)
252252
.withRequestContextDataAppSec("dummy");
253253

254-
AgentSpan top = tracer.buildSpan("top").asChildOf((AgentSpanContext) extracted).start();
254+
AgentSpan top =
255+
tracer.buildSpan("datadog", "top").asChildOf((AgentSpanContext) extracted).start();
255256
DDSpanContext topC = (DDSpanContext) top.context();
256257
TraceSegment topTS = top.getRequestContext().getTraceSegment();
257258

258-
AgentSpan current = tracer.buildSpan("current").asChildOf(top.context()).start();
259+
AgentSpan current = tracer.buildSpan("datadog", "current").asChildOf(top.context()).start();
259260
TraceSegment currentTS = current.getRequestContext().getTraceSegment();
260261
DDSpanContext currentC = (DDSpanContext) current.context();
261262

@@ -295,7 +296,7 @@ void setTraceSegmentTagsAndDataOnCorrectSpan() {
295296
void setSingleSpanSamplingTags(double rate, int limit) {
296297
AgentSpan span =
297298
tracer
298-
.buildSpan("fakeOperation")
299+
.buildSpan("datadog", "fakeOperation")
299300
.withServiceName("fakeService")
300301
.withResourceName("fakeResource")
301302
.start();
@@ -321,7 +322,7 @@ void setSingleSpanSamplingTags(double rate, int limit) {
321322
void settingResourceNameToNullIsIgnored() {
322323
AgentSpan span =
323324
tracer
324-
.buildSpan("fakeOperation")
325+
.buildSpan("datadog", "fakeOperation")
325326
.withServiceName("fakeService")
326327
.withResourceName("fakeResource")
327328
.start();
@@ -340,7 +341,7 @@ void settingOperationNameTriggersConstantEncoding() {
340341

341342
AgentSpan span =
342343
tracer
343-
.buildSpan("fakeOperation")
344+
.buildSpan("datadog", "fakeOperation")
344345
.withServiceName("fakeService")
345346
.withResourceName("fakeResource")
346347
.start();
@@ -369,15 +370,15 @@ void settingOperationNameTriggersConstantEncoding() {
369370
void spanIdsPrintedAsUnsignedLong() {
370371
AgentSpan parent =
371372
tracer
372-
.buildSpan("fakeOperation")
373+
.buildSpan("datadog", "fakeOperation")
373374
.withServiceName("fakeService")
374375
.withResourceName("fakeResource")
375376
.withSpanId(-987654321)
376377
.start();
377378

378379
AgentSpan span =
379380
tracer
380-
.buildSpan("fakeOperation")
381+
.buildSpan("datadog", "fakeOperation")
381382
.withServiceName("fakeService")
382383
.withResourceName("fakeResource")
383384
.withSpanId(-123456789)
@@ -397,9 +398,11 @@ void spanIdsPrintedAsUnsignedLong() {
397398

398399
@Test
399400
void serviceNameSourceIsPropagatedFromParentToChildSpan() {
400-
AgentSpan parent = tracer.buildSpan("parentOperation").withServiceName("fakeService").start();
401+
AgentSpan parent =
402+
tracer.buildSpan("datadog", "parentOperation").withServiceName("fakeService").start();
401403

402-
AgentSpan child = tracer.buildSpan("childOperation").asChildOf(parent.context()).start();
404+
AgentSpan child =
405+
tracer.buildSpan("datadog", "childOperation").asChildOf(parent.context()).start();
403406
DDSpanContext childContext = (DDSpanContext) child.context();
404407

405408
assertEquals(ServiceNameSources.MANUAL, childContext.getServiceNameSource());

dd-trace-core/src/test/java/datadog/trace/core/DDSpanTest.java

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -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);

dd-trace-core/src/test/java/datadog/trace/core/KnuthSamplingRateTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void agentRateSamplerSetsKsrPropagatedTag(String scenario, double rate, String e
7676
DDSpan span =
7777
(DDSpan)
7878
tracer
79-
.buildSpan("fakeOperation")
79+
.buildSpan("datadog", "fakeOperation")
8080
.withServiceName("spock")
8181
.withTag("env", "test")
8282
.ignoreActiveSpan()
@@ -107,7 +107,7 @@ void ruleBasedSamplerSetsKsrPropagatedTagWhenRuleMatches(
107107
DDSpan span =
108108
(DDSpan)
109109
tracer
110-
.buildSpan("operation")
110+
.buildSpan("datadog", "operation")
111111
.withServiceName("service")
112112
.withTag("env", "bar")
113113
.ignoreActiveSpan()
@@ -134,7 +134,7 @@ void ruleBasedSamplerFallbackToAgentSamplerSetsKsr() {
134134
DDSpan span =
135135
(DDSpan)
136136
tracer
137-
.buildSpan("operation")
137+
.buildSpan("datadog", "operation")
138138
.withServiceName("service")
139139
.withTag("env", "bar")
140140
.ignoreActiveSpan()
@@ -160,7 +160,7 @@ void serviceRuleSamplerSetsKsrPropagatedTag() {
160160
DDSpan span =
161161
(DDSpan)
162162
tracer
163-
.buildSpan("operation")
163+
.buildSpan("datadog", "operation")
164164
.withServiceName("service")
165165
.withTag("env", "bar")
166166
.ignoreActiveSpan()
@@ -185,7 +185,7 @@ void defaultRateSamplerSetsKsrPropagatedTag() {
185185
DDSpan span =
186186
(DDSpan)
187187
tracer
188-
.buildSpan("operation")
188+
.buildSpan("datadog", "operation")
189189
.withServiceName("service")
190190
.withTag("env", "bar")
191191
.ignoreActiveSpan()
@@ -213,7 +213,7 @@ void ksrIsPropagatedViaXDatadogTagsHeader() {
213213
DDSpan span =
214214
(DDSpan)
215215
tracer
216-
.buildSpan("fakeOperation")
216+
.buildSpan("datadog", "fakeOperation")
217217
.withServiceName("spock")
218218
.withTag("env", "test")
219219
.ignoreActiveSpan()

0 commit comments

Comments
 (0)