Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class AxisEngineTest extends InstrumentationSpecification {
}
topLevel parentSpan == null
tags {
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -415,7 +415,7 @@ class AxisEngineTest extends InstrumentationSpecification {
"error.stack" String
}
"$Tags.COMPONENT" "axis2"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class AxisTransportForkedTest extends InstrumentationSpecification {
topLevel parentSpan == null
tags {
// manual tracing
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -161,7 +161,7 @@ class AxisTransportForkedTest extends InstrumentationSpecification {
"error.stack" String
}
"$Tags.COMPONENT" "axis2"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand Down Expand Up @@ -200,7 +200,7 @@ class AxisTransportForkedTest extends InstrumentationSpecification {
"$Tags.HTTP_STATUS" 200
"$Tags.PEER_HOSTNAME" "my-host"
"$Tags.PEER_PORT" 8080
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TraceAnnotationNewOpNameForkedTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -50,7 +50,7 @@ class TraceAnnotationNewOpNameForkedTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TraceAnnotationsAsyncTest extends InstrumentationSpecification {
resourceName "SayTracedHello.sayHelloFuture"
operationName "trace.annotation"
tags {
serviceNameSource null
serviceNameSource "m"
defaultTags()
"$Tags.COMPONENT" "trace"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -51,7 +51,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -75,7 +75,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -100,7 +100,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -123,7 +123,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -135,7 +135,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -147,7 +147,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -170,7 +170,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -182,7 +182,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -194,7 +194,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -217,7 +217,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -229,7 +229,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -241,7 +241,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -267,7 +267,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored true
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
errorTags(error.class)
defaultTags()
}
Expand All @@ -294,7 +294,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored true
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
errorTags(error.class)
defaultTags()
}
Expand All @@ -316,7 +316,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
operationName "trace.annotation"
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -342,7 +342,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
operationName "trace.annotation"
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -352,7 +352,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
operationName "trace.annotation"
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand Down Expand Up @@ -390,7 +390,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -403,7 +403,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand Down Expand Up @@ -441,7 +441,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
measured false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -454,7 +454,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
measured true
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -467,7 +467,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
measured false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand Down Expand Up @@ -504,7 +504,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -516,7 +516,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand All @@ -530,7 +530,7 @@ class TraceAnnotationsTest extends InstrumentationSpecification {
errored false
tags {
"$Tags.COMPONENT" "trace"
serviceNameSource null
serviceNameSource "m"
defaultTags()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class OpenTelemetry14ConventionsTest extends InstrumentationSpecification {
serviceName "my-service"
spanType "http"
tags {
serviceNameSource null //service name was manually set
serviceNameSource "m" //service name was manually set
defaultTags()
"$SPAN_KIND" "$SPAN_KIND_INTERNAL"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class WithSpanAnnotationTest extends InstrumentationSpecification {
parent()
errored false
tags {
serviceNameSource null // manual service name
serviceNameSource "m" // manual service name
defaultTags()
"$Tags.COMPONENT" "opentelemetry"
"$Tags.SPAN_KIND" "internal"
Expand All @@ -52,7 +52,7 @@ class WithSpanAnnotationTest extends InstrumentationSpecification {
parent()
errored false
tags {
serviceNameSource null // manual service name
serviceNameSource "m" // manual service name
defaultTags()
"$Tags.COMPONENT" "opentelemetry"
"$Tags.SPAN_KIND" "internal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class WildFlyForkedTest extends WithHttpServer<EmbeddedWildfly> implements Testi
"$InstrumentationTags.SERVLET_PATH" "/hello"
"custom-metric" 1983
// the service name is set as tag - no source expected right now
serviceNameSource null
serviceNameSource "m"
defaultTags(true)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static datadog.trace.api.DDTags.TRACE_START_TIME;
import static datadog.trace.api.sampling.SamplingMechanism.DEFAULT;
import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.RECORD_END_TO_END_DURATION_MS;
import static datadog.trace.bootstrap.instrumentation.api.ServiceNameSources.MANUAL;
import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_STATUS;
import static java.util.concurrent.TimeUnit.MICROSECONDS;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
Expand Down Expand Up @@ -581,7 +582,7 @@ public final DDSpan setOperationName(final CharSequence operationName) {

@Override
public final DDSpan setServiceName(final String serviceName) {
context.setServiceName(serviceName);
setServiceName(serviceName, MANUAL);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static datadog.trace.api.DDTags.SPAN_LINKS;
import static datadog.trace.api.cache.RadixTreeCache.HTTP_STATUSES;
import static datadog.trace.bootstrap.instrumentation.api.ErrorPriorities.UNSET;
import static datadog.trace.bootstrap.instrumentation.api.ServiceNameSources.MANUAL;

import datadog.trace.api.Config;
import datadog.trace.api.DDSpanId;
Expand Down Expand Up @@ -324,7 +325,7 @@ public DDSpanContext(
// to get away with doing this just once per span
this.encodedOperationName = profilingContextIntegration.encodeOperationName(operationName);

setServiceName(serviceName);
internalSetServiceName(serviceName);
this.serviceNameSource = serviceNameSource;
this.operationName = operationName;
setResourceName(resourceName, ResourceNamePriorities.DEFAULT);
Expand Down Expand Up @@ -391,13 +392,12 @@ private void internalSetServiceName(String serviceName) {
}

public void setServiceName(final String serviceName) {
internalSetServiceName(serviceName);
setServiceNameSource(null);
setServiceName(serviceName, MANUAL);
}

public void setServiceName(String serviceName, @Nonnull CharSequence integrationName) {
public void setServiceName(String serviceName, @Nonnull CharSequence source) {
internalSetServiceName(serviceName);
setServiceNameSource(Objects.requireNonNull(integrationName));
setServiceNameSource(Objects.requireNonNull(source));
}

public CharSequence getServiceNameSource() {
Expand Down
Loading
Loading