Skip to content

Commit 5bfab65

Browse files
amarzialimcculls
andauthored
Introducing an internal integration name (#8708)
* Introducing an internal instrumentation component name * fix tests * fix ci viz tests * Change tag name and use otel instead opentelemetry * Add assertions for instrumentation which changes component tag * fix dropwizard tests * Fix latest finatra tests * Add instrumentation tag to netty connect spans * Add instrumentation tag to dropwizard view spans * fix tests * fix ci viz smoke tests * Rename to instrumentationName * Update dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/InstrumentationComponentAdderTest.groovy Co-authored-by: Stuart McCulloch <[email protected]> * Update dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/InstrumentationComponentAdder.java Co-authored-by: Stuart McCulloch <[email protected]> * Update dd-trace-core/src/main/java/datadog/trace/core/DDSpanContext.java Co-authored-by: Stuart McCulloch <[email protected]> * codenarc * cleanup httpservertest * Update dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/InstrumentationComponentAdder.java Co-authored-by: Stuart McCulloch <[email protected]> * change system test commit * rename * update system test commit --------- Co-authored-by: Stuart McCulloch <[email protected]>
1 parent b92f0c0 commit 5bfab65

File tree

48 files changed

+181
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+181
-15
lines changed

.circleci/config.continue.yml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ instrumentation_modules: &instrumentation_modules "dd-java-agent/instrumentation
3636
debugger_modules: &debugger_modules "dd-java-agent/agent-debugger|dd-java-agent/agent-bootstrap|dd-java-agent/agent-builder|internal-api|communication|dd-trace-core"
3737
profiling_modules: &profiling_modules "dd-java-agent/agent-profiling"
3838

39-
default_system_tests_commit: &default_system_tests_commit 380d8deb4dd86369e30827ae3d908400c91d2d3e
39+
default_system_tests_commit: &default_system_tests_commit 121787cbd6b3e5bc2840a0d5df17ecfb45566837
4040

4141
parameters:
4242
nightly:

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/BaseDecorator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ public AgentSpan afterStart(final AgentSpan span) {
6969
if (spanType() != null) {
7070
span.setSpanType(spanType());
7171
}
72-
span.setTag(Tags.COMPONENT, component());
72+
final CharSequence component = component();
73+
span.setTag(Tags.COMPONENT, component);
74+
span.context().setIntegrationName(component);
7375
if (traceAnalyticsEnabled) {
7476
span.setMetric(DDTags.ANALYTICS_SAMPLE_RATE, traceAnalyticsSampleRate);
7577
}

dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/BaseDecoratorTest.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package datadog.trace.bootstrap.instrumentation.decorator
22

33

44
import datadog.trace.bootstrap.instrumentation.api.AgentSpan
5+
import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext
56
import datadog.trace.bootstrap.instrumentation.api.ErrorPriorities
67
import datadog.trace.bootstrap.instrumentation.api.Tags
78
import datadog.trace.test.util.DDSpecification
@@ -16,6 +17,7 @@ class BaseDecoratorTest extends DDSpecification {
1617
def errorPriority = null as Byte
1718

1819
def span = Mock(AgentSpan)
20+
def spanContext = Mock(AgentSpanContext)
1921

2022
def "test afterStart"() {
2123
when:
@@ -24,6 +26,8 @@ class BaseDecoratorTest extends DDSpecification {
2426
then:
2527
1 * span.setSpanType(decorator.spanType())
2628
1 * span.setTag(Tags.COMPONENT, "test-component")
29+
1 * span.context() >> spanContext
30+
1 * spanContext.setIntegrationName("test-component")
2731
_ * span.setTag(_, _) // Want to allow other calls from child implementations.
2832
_ * span.setMeasured(true)
2933
_ * span.setMetric(_, _)

dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/ClientDecoratorTest.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package datadog.trace.bootstrap.instrumentation.decorator
22

33
import datadog.trace.api.DDTags
44
import datadog.trace.bootstrap.instrumentation.api.AgentSpan
5+
import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext
56
import datadog.trace.bootstrap.instrumentation.api.Tags
67

78
class ClientDecoratorTest extends BaseDecoratorTest {
@@ -11,6 +12,7 @@ class ClientDecoratorTest extends BaseDecoratorTest {
1112
def "test afterStart"() {
1213
setup:
1314
def decorator = newDecorator((String) serviceName)
15+
def spanContext = Mock(AgentSpanContext)
1416

1517
when:
1618
decorator.afterStart(span)
@@ -21,6 +23,8 @@ class ClientDecoratorTest extends BaseDecoratorTest {
2123
}
2224
1 * span.setMeasured(true)
2325
1 * span.setTag(Tags.COMPONENT, "test-component")
26+
1 * span.context() >> spanContext
27+
1 * spanContext.setIntegrationName("test-component")
2428
1 * span.setTag(Tags.SPAN_KIND, "client")
2529
1 * span.setSpanType(decorator.spanType())
2630
1 * span.setMetric(DDTags.ANALYTICS_SAMPLE_RATE, 1.0)

dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/DBTypeProcessingDatabaseClientDecoratorTest.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class DBTypeProcessingDatabaseClientDecoratorTest extends ClientDecoratorTest {
2424
}
2525
1 * span.setMeasured(true)
2626
1 * span.setTag(Tags.COMPONENT, "test-component")
27+
1 * span.context() >> spanContext
28+
1 * spanContext.setIntegrationName("test-component")
2729
1 * span.setTag(Tags.SPAN_KIND, "client")
2830
1 * span.setSpanType("test-type")
2931
1 * span.setServiceName("test-db")

dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/DatabaseClientDecoratorTest.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package datadog.trace.bootstrap.instrumentation.decorator
22

33
import datadog.trace.api.DDTags
44
import datadog.trace.bootstrap.instrumentation.api.AgentSpan
5+
import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext
56
import datadog.trace.bootstrap.instrumentation.api.Tags
67

78
import static datadog.trace.api.config.TraceInstrumentationConfig.DB_CLIENT_HOST_SPLIT_BY_HOST
@@ -15,6 +16,7 @@ class DatabaseClientDecoratorTest extends ClientDecoratorTest {
1516
def "test afterStart"() {
1617
setup:
1718
def decorator = newDecorator((String) serviceName)
19+
def spanContext = Mock(AgentSpanContext)
1820

1921
when:
2022
decorator.afterStart(span)
@@ -25,6 +27,8 @@ class DatabaseClientDecoratorTest extends ClientDecoratorTest {
2527
}
2628
1 * span.setMeasured(true)
2729
1 * span.setTag(Tags.COMPONENT, "test-component")
30+
1 * span.context() >> spanContext
31+
1 * spanContext.setIntegrationName("test-component")
2832
1 * span.setTag(Tags.SPAN_KIND, "client")
2933
1 * span.setSpanType("test-type")
3034
1 * span.setMetric(DDTags.ANALYTICS_SAMPLE_RATE, 1.0)

dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/ServerDecoratorTest.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package datadog.trace.bootstrap.instrumentation.decorator
22

33

44
import datadog.trace.bootstrap.instrumentation.api.AgentSpan
5+
import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext
56

67
import static datadog.trace.api.DDTags.ANALYTICS_SAMPLE_RATE
78
import static datadog.trace.api.DDTags.LANGUAGE_TAG_KEY
@@ -15,12 +16,16 @@ class ServerDecoratorTest extends BaseDecoratorTest {
1516

1617
def "test afterStart"() {
1718
def decorator = newDecorator()
19+
def spanContext = Mock(AgentSpanContext)
20+
1821
when:
1922
decorator.afterStart(span)
2023

2124
then:
2225
1 * span.setTag(LANGUAGE_TAG_KEY, LANGUAGE_TAG_VALUE)
2326
1 * span.setTag(COMPONENT, "test-component")
27+
1 * span.context() >> spanContext
28+
1 * spanContext.setIntegrationName("test-component")
2429
1 * span.setTag(SPAN_KIND, "server")
2530
1 * span.setSpanType(decorator.spanType())
2631
if (decorator.traceAnalyticsEnabled) {

dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/decorator/TestDecoratorImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public AgentSpan afterStart(final AgentSpan span) {
5151
span.setTag(DDTags.HOST_VCPU_COUNT, cpuCount);
5252
span.setTag(Tags.TEST_TYPE, testType());
5353
span.setTag(Tags.COMPONENT, component());
54+
span.context().setIntegrationName(component());
5455
span.setTag(Tags.TEST_SESSION_NAME, sessionName);
5556

5657
for (final Map.Entry<String, String> ciTag : ciTags.entrySet()) {

dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/decorator/TestDecoratorImplTest.groovy

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,27 @@ package datadog.trace.civisibility.decorator
33
import datadog.trace.api.DDTags
44
import datadog.trace.api.sampling.PrioritySampling
55
import datadog.trace.bootstrap.instrumentation.api.AgentSpan
6+
import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext
67
import datadog.trace.bootstrap.instrumentation.api.Tags
78
import spock.lang.Specification
89

910
class TestDecoratorImplTest extends Specification {
1011

1112
def span = Mock(AgentSpan)
13+
def context = Mock(AgentSpanContext)
14+
1215

1316
def "test afterStart"() {
1417
setup:
1518
def decorator = new TestDecoratorImpl("test-component", "session-name", "test-command", ["ci-tag-1": "value", "ci-tag-2": "another value"])
16-
1719
when:
1820
decorator.afterStart(span)
1921

2022
then:
2123
1 * span.setTag(Tags.TEST_SESSION_NAME, "session-name")
2224
1 * span.setTag(Tags.COMPONENT, "test-component")
25+
1 * span.context() >> context
26+
1 * context.setIntegrationName("test-component")
2327
1 * span.setTag(Tags.TEST_TYPE, decorator.testType())
2428
1 * span.setSamplingPriority(PrioritySampling.SAMPLER_KEEP)
2529
1 * span.setTag(DDTags.ORIGIN_KEY, decorator.origin())
@@ -44,6 +48,8 @@ class TestDecoratorImplTest extends Specification {
4448
decorator.afterStart(span)
4549

4650
then:
51+
1 * span.context() >> context
52+
1 * context.setIntegrationName("test-component")
4753
1 * span.setTag(Tags.TEST_SESSION_NAME, expectedSessionName)
4854

4955
where:

dd-java-agent/agent-ci-visibility/src/testFixtures/groovy/datadog/trace/civisibility/CiVisibilitySmokeTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ abstract class CiVisibilitySmokeTest extends Specification {
1212
def baseTemplatesPath = CiVisibilitySmokeTest.classLoader.getResource(projectName).toURI().schemeSpecificPart.replace('build/resources/test', 'src/test/resources')
1313
CiVisibilityTestUtils.generateTemplates(baseTemplatesPath, events, coverages, additionalReplacements)
1414
} else {
15-
CiVisibilityTestUtils.assertData(projectName, events, coverages, additionalReplacements, [])
15+
CiVisibilityTestUtils.assertData(projectName, events, coverages, additionalReplacements,["content.meta.['_dd.integration']"])
1616
}
1717
}
1818

dd-java-agent/agent-ci-visibility/src/testFixtures/groovy/datadog/trace/civisibility/CiVisibilityTestUtils.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ abstract class CiVisibilityTestUtils {
5555
]
5656

5757
// ignored tags on assertion and fixture build
58-
static final List<String> IGNORED_TAGS = LibraryCapability.values().toList().stream().map(c -> "content.meta.['${c.asTag()}']").collect(Collectors.toList())
58+
static final List<String> IGNORED_TAGS = LibraryCapability.values().toList().stream().map(c -> "content.meta.['${c.asTag()}']").collect(Collectors.toList()) +
59+
["content.meta.['_dd.integration']"]
5960

6061
static final List<DynamicPath> COVERAGE_DYNAMIC_PATHS = [path("test_session_id"), path("test_suite_id"), path("span_id"),]
6162

dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/trace/OtelSpan.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public OtelSpan(AgentSpan delegate) {
4343
}
4444
this.statusCode = UNSET;
4545
this.recording = true;
46+
delegate.context().setIntegrationName("otel");
4647
}
4748

4849
public static Span invalid() {

dd-java-agent/instrumentation/cxf-2.1/src/latestDepTest/groovy/CxfContextPropagationTest.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class CxfContextPropagationTest extends AgentTestRunner {
7575
"$InstrumentationTags.SERVLET_PATH" "/test"
7676
"$Tags.HTTP_USER_AGENT" String
7777
"$Tags.HTTP_CLIENT_IP" "127.0.0.1"
78+
withCustomIntegrationName("jetty-server")
7879
defaultTags()
7980
}
8081
}

dd-java-agent/instrumentation/cxf-2.1/src/test/groovy/CxfContextPropagationTest.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class CxfContextPropagationTest extends AgentTestRunner {
7373
"servlet.path" { it == null || it == "/test" }
7474
"$Tags.HTTP_USER_AGENT" String
7575
"$Tags.HTTP_CLIENT_IP" "127.0.0.1"
76+
withCustomIntegrationName("jetty-server")
7677
defaultTags()
7778
}
7879
}

dd-java-agent/instrumentation/dropwizard/dropwizard-views/src/main/java/datadog/trace/instrumentation/dropwizard/view/DropwizardViewInstrumentation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public static AgentScope onEnter(
7070
return null;
7171
}
7272
final AgentSpan span = startSpan("view.render").setTag(Tags.COMPONENT, "dropwizard-view");
73+
span.context().setIntegrationName("dropwizard-view");
7374
span.setResourceName("View " + view.getTemplateName());
7475
return activateSpan(span);
7576
}

dd-java-agent/instrumentation/dropwizard/src/test/groovy/DropwizardTest.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ class DropwizardTest extends HttpServerTest<DropwizardTestSupport> {
9393
return "/${endpoint.relativeRawPath()}"
9494
}
9595

96+
@Override
97+
String expectedIntegrationName() {
98+
"java-web-servlet"
99+
}
100+
96101
@Override
97102
boolean hasHandlerSpan() {
98103
true

dd-java-agent/instrumentation/finatra-2.9/src/latestDepTest/groovy/FinatraServer270Test.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ class FinatraServer270Test extends HttpServerTest<HttpServer> {
2525
}
2626
}
2727

28+
@Override
29+
String expectedIntegrationName() {
30+
"netty"
31+
}
32+
2833
@Override
2934
HttpServer startServer(int port) {
3035
HttpServer testServer = new FinatraServer()

dd-java-agent/instrumentation/finatra-2.9/src/test/groovy/FinatraServerTest.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ abstract class FinatraServerTest extends HttpServerTest<HttpServer> {
7676
return false
7777
}
7878

79+
@Override
80+
String expectedIntegrationName() {
81+
"netty"
82+
}
83+
7984
void handlerSpan(TraceAssert trace, ServerEndpoint endpoint = SUCCESS) {
8085
def errorEndpoint = endpoint == EXCEPTION || endpoint == ERROR
8186
trace.span {

dd-java-agent/instrumentation/jakarta-rs-annotations-3/src/test/groovy/JakartaRsAnnotations3InstrumentationTest.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class JakartaRsAnnotations3InstrumentationTest extends AgentTestRunner {
5959
tags {
6060
"$Tags.COMPONENT" "jakarta-rs"
6161
"$Tags.HTTP_ROUTE" name.split(" ").last()
62+
withCustomIntegrationName(null)
6263
defaultTags()
6364
}
6465
}

dd-java-agent/instrumentation/java-lang/src/main/java/datadog/trace/instrumentation/java/lang/ProcessImplStartAdvice.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public static AgentSpan startSpan(@Advice.Argument(0) final String[] command) th
2222
span.setSpanType("system");
2323
span.setResourceName(ProcessImplInstrumentationHelpers.determineResource(command));
2424
span.setTag("component", "subprocess");
25+
span.context().setIntegrationName("subprocess");
2526
ProcessImplInstrumentationHelpers.setTags(span, command);
2627
ProcessImplInstrumentationHelpers.cmdiRaspCheck(command);
2728
return span;

dd-java-agent/instrumentation/jax-rs-annotations-1/src/test/groovy/JaxRsAnnotations1InstrumentationTest.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class JaxRsAnnotations1InstrumentationTest extends AgentTestRunner {
5959
tags {
6060
"$Tags.COMPONENT" "jax-rs"
6161
"$Tags.HTTP_ROUTE" name.split(" ").last()
62+
withCustomIntegrationName(null)
6263
defaultTags()
6364
}
6465
}

dd-java-agent/instrumentation/jax-rs-annotations-1/src/test/groovy/JerseyTest.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class JerseyTest extends AgentTestRunner {
3535
tags {
3636
"$Tags.COMPONENT" "jax-rs"
3737
"$Tags.HTTP_ROUTE" expectedResourceName.split(" ").last()
38+
withCustomIntegrationName(null)
3839
defaultTags()
3940
}
4041
}
@@ -78,6 +79,7 @@ class JerseyTest extends AgentTestRunner {
7879
tags {
7980
"$Tags.COMPONENT" "jax-rs"
8081
"$Tags.HTTP_ROUTE" parentResourceName.split(" ").last()
82+
withCustomIntegrationName(null)
8183
defaultTags()
8284
}
8385
}

dd-java-agent/instrumentation/jax-rs-annotations-2/src/nestedTest/groovy/NestedResourcesTest.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class NestedResourcesTest extends AgentTestRunner {
4444
tags {
4545
"$Tags.COMPONENT" "jax-rs"
4646
"$Tags.HTTP_ROUTE" "/admin/realms"
47+
withCustomIntegrationName(null)
4748
defaultTags()
4849
}
4950
}

dd-java-agent/instrumentation/jax-rs-annotations-2/src/test/groovy/JaxRsAnnotations2InstrumentationTest.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class JaxRsAnnotations2InstrumentationTest extends AgentTestRunner {
5959
tags {
6060
"$Tags.COMPONENT" "jax-rs"
6161
"$Tags.HTTP_ROUTE" name.split(" ").last()
62+
withCustomIntegrationName(null)
6263
defaultTags()
6364
}
6465
}

dd-java-agent/instrumentation/jax-rs-annotations-2/src/test/groovy/JaxRsFilterTest.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ abstract class JaxRsFilterTest extends AgentTestRunner {
6363
if (httpRoute) {
6464
"$Tags.HTTP_ROUTE" httpRoute
6565
}
66+
withCustomIntegrationName(null)
6667
defaultTags()
6768
}
6869
}
@@ -123,6 +124,7 @@ abstract class JaxRsFilterTest extends AgentTestRunner {
123124
tags {
124125
"$Tags.COMPONENT" "jax-rs"
125126
"$Tags.HTTP_ROUTE" resource
127+
withCustomIntegrationName(null)
126128
defaultTags()
127129
}
128130
}

dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/JDBCDecorator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ private AgentSpan withQueryInfo(AgentSpan span, DBQueryInfo info, CharSequence c
241241
} else {
242242
span.setResourceName(DB_QUERY);
243243
}
244+
span.context().setIntegrationName(component);
244245
return span.setTag(Tags.COMPONENT, component);
245246
}
246247

dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateTracingHook.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ public boolean beforeStep(Step step, ScenarioRuntime sr) {
201201
String stepName = step.getPrefix() + " " + step.getText();
202202
span.setResourceName(stepName);
203203
span.setTag(Tags.COMPONENT, "karate");
204+
span.context().setIntegrationName("karate");
204205
span.setTag("step.name", stepName);
205206
span.setTag("step.startLine", step.getLine());
206207
span.setTag("step.endLine", step.getEndLine());

dd-java-agent/instrumentation/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/ChannelFutureListenerInstrumentation.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
66
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
77
import static datadog.trace.instrumentation.netty38.server.NettyHttpServerDecorator.DECORATE;
8+
import static datadog.trace.instrumentation.netty38.server.NettyHttpServerDecorator.NETTY;
89
import static datadog.trace.instrumentation.netty38.server.NettyHttpServerDecorator.NETTY_CONNECT;
910
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
1011
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
@@ -107,6 +108,7 @@ public static AgentScope activateScope(@Advice.Argument(0) final ChannelFuture f
107108
final AgentScope parentScope = continuation.activate();
108109

109110
final AgentSpan errorSpan = startSpan(NETTY_CONNECT).setTag(Tags.COMPONENT, "netty");
111+
errorSpan.context().setIntegrationName(NETTY);
110112
try (final AgentScope scope = activateSpan(errorSpan)) {
111113
DECORATE.onError(errorSpan, cause);
112114
DECORATE.beforeFinish(errorSpan);

dd-java-agent/instrumentation/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/ChannelFutureListenerInstrumentation.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
66
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
77
import static datadog.trace.instrumentation.netty40.AttributeKeys.CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY;
8+
import static datadog.trace.instrumentation.netty40.server.NettyHttpServerDecorator.NETTY;
89
import static datadog.trace.instrumentation.netty40.server.NettyHttpServerDecorator.NETTY_CONNECT;
910
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
1011
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
@@ -92,6 +93,7 @@ public static AgentScope activateScope(@Advice.Argument(0) final ChannelFuture f
9293
final AgentScope parentScope = continuation.activate();
9394

9495
final AgentSpan errorSpan = startSpan(NETTY_CONNECT).setTag(Tags.COMPONENT, "netty");
96+
errorSpan.context().setIntegrationName(NETTY);
9597
try (final AgentScope scope = activateSpan(errorSpan)) {
9698
NettyHttpServerDecorator.DECORATE.onError(errorSpan, cause);
9799
NettyHttpServerDecorator.DECORATE.beforeFinish(errorSpan);

dd-java-agent/instrumentation/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/ChannelFutureListenerInstrumentation.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
66
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
77
import static datadog.trace.instrumentation.netty41.AttributeKeys.CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY;
8+
import static datadog.trace.instrumentation.netty41.server.NettyHttpServerDecorator.NETTY;
89
import static datadog.trace.instrumentation.netty41.server.NettyHttpServerDecorator.NETTY_CONNECT;
910
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
1011
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
@@ -92,6 +93,7 @@ public static AgentScope activateScope(@Advice.Argument(0) final ChannelFuture f
9293
final AgentScope parentScope = continuation.activate();
9394

9495
final AgentSpan errorSpan = startSpan(NETTY_CONNECT).setTag(Tags.COMPONENT, "netty");
96+
errorSpan.context().setIntegrationName(NETTY);
9597
try (final AgentScope scope = activateSpan(errorSpan)) {
9698
NettyHttpServerDecorator.DECORATE.onError(errorSpan, cause);
9799
NettyHttpServerDecorator.DECORATE.beforeFinish(errorSpan);

0 commit comments

Comments
 (0)