Skip to content

Commit 1416a77

Browse files
committed
feat(core): Remove instrumentation name
1 parent be57c26 commit 1416a77

File tree

30 files changed

+34
-37
lines changed

30 files changed

+34
-37
lines changed

dd-java-agent/agent-bootstrap/src/jmh/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecoratorBenchmark.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void setUp() {
5959
.build();
6060
GlobalTracer.forceRegister(tracer);
6161
decorator = new BenchmarkHttpServerDecorator();
62-
Context context = decorator.startSpan("benchmark", Collections.emptyMap(), Context.root());
62+
Context context = decorator.startSpan(Collections.emptyMap(), Context.root());
6363
span = fromContext(context);
6464
}
6565

@@ -101,7 +101,7 @@ public BenchmarkHttpServerDecorator() {
101101

102102
@Override
103103
protected String[] instrumentationNames() {
104-
return new String[0];
104+
return new String[] {"benchmark"};
105105
}
106106

107107
@Override

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,7 @@ public Context extract(REQUEST_CARRIER carrier) {
139139
* @param context The parent context of the span to create.
140140
* @return A new context bundling the span, child of the given parent context.
141141
*/
142-
public Context startSpan(
143-
String unused, // TODO Remove
144-
REQUEST_CARRIER carrier,
145-
Context context) { // TODO Rename "context" to "parent"?
142+
public Context startSpan(REQUEST_CARRIER carrier, Context context) {
146143
String instrumentationName =
147144
instrumentationNames().length == 0 ? "http-server" : instrumentationNames()[0];
148145
AgentSpanContext.Extracted spanContext = getExtractedSpanContext(context);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ class HttpServerDecoratorTest extends ServerDecoratorTest {
498498
def decorator = newDecorator(mTracer, null)
499499

500500
when:
501-
decorator.startSpan("test", headers, root())
501+
decorator.startSpan(headers, root())
502502

503503
then:
504504
1 * mSpan.setMeasured(true) >> mSpan

dd-java-agent/instrumentation/akka/akka-http/akka-http-10.0/src/main/java/datadog/trace/instrumentation/akkahttp/DatadogWrapperHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
public class DatadogWrapperHelper {
1313
public static ContextScope createSpan(final HttpRequest request) {
1414
final Context parentContext = DECORATE.extract(request);
15-
final Context context = DECORATE.startSpan("akka-http", request, parentContext);
15+
final Context context = DECORATE.startSpan(request, parentContext);
1616
final AgentSpan span = spanFromContext(context);
1717
DECORATE.afterStart(span);
1818
DECORATE.onRequest(span, request, request, parentContext);

dd-java-agent/instrumentation/azure-functions/src/main/java/datadog/trace/instrumentation/azure/functions/AzureFunctionsInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static ContextScope methodEnter(
6868
@Advice.Argument(0) final HttpRequestMessage<?> request,
6969
@Advice.Argument(1) final ExecutionContext executionContext) {
7070
final Context parentContext = DECORATE.extract(request);
71-
final Context context = DECORATE.startSpan("azure-functions", request, parentContext);
71+
final Context context = DECORATE.startSpan(request, parentContext);
7272
final AgentSpan span = spanFromContext(context);
7373
DECORATE.afterStart(span, executionContext.getFunctionName());
7474
DECORATE.onRequest(span, request, request, parentContext);

dd-java-agent/instrumentation/grizzly-2/src/main/java/datadog/trace/instrumentation/grizzly/GrizzlyHttpHandlerInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static class HandleAdvice {
7373
}
7474

7575
final Context parentContext = DECORATE.extract(request);
76-
final Context context = DECORATE.startSpan("grizzly", request, parentContext);
76+
final Context context = DECORATE.startSpan(request, parentContext);
7777
final AgentSpan span = spanFromContext(context);
7878
DECORATE.afterStart(span);
7979
DECORATE.onRequest(span, request, request, parentContext);

dd-java-agent/instrumentation/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyDecorator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public static NextAction onHttpCodecFilterExit(
115115
HttpRequestPacket httpRequest = (HttpRequestPacket) httpHeader;
116116
HttpResponsePacket httpResponse = httpRequest.getResponse();
117117
Context parentContext = DECORATE.extract(httpRequest);
118-
Context context = DECORATE.startSpan("grizzly", httpRequest, parentContext);
118+
Context context = DECORATE.startSpan(httpRequest, parentContext);
119119
ContextScope scope = context.attach();
120120
AgentSpan span = spanFromContext(context);
121121
DECORATE.afterStart(span);

dd-java-agent/instrumentation/jetty-11/src/main/java11/datadog/trace/instrumentation/jetty11/JettyServerAdvice.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static ContextScope onEnter(
2727
}
2828

2929
final Context parentContext = DECORATE.extract(req);
30-
final Context context = DECORATE.startSpan("jetty", req, parentContext);
30+
final Context context = DECORATE.startSpan(req, parentContext);
3131
final ContextScope scope = context.attach();
3232
span = spanFromContext(context);
3333
span.setMeasured(true);

dd-java-agent/instrumentation/jetty-12/src/main/java17/datadog/trace/instrumentation/jetty12/JettyServerAdvice.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public static void onExit(
2929
}
3030

3131
final Context parentContext = DECORATE.extract(req);
32-
final Context context = DECORATE.startSpan("jetty", req, parentContext);
33-
try (final ContextScope scope = context.attach()) {
32+
final Context context = DECORATE.startSpan(req, parentContext);
33+
try (final ContextScope ignored = context.attach()) {
3434
final AgentSpan span = spanFromContext(context);
3535
span.setMeasured(true);
3636
DECORATE.afterStart(span);

dd-java-agent/instrumentation/jetty-7.0/src/main/java/datadog/trace/instrumentation/jetty70/JettyServerInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public static ContextScope onEnter(
156156
}
157157

158158
final Context parentContext = DECORATE.extract(req);
159-
final Context context = DECORATE.startSpan("jetty", req, parentContext);
159+
final Context context = DECORATE.startSpan(req, parentContext);
160160
final ContextScope scope = context.attach();
161161
span = spanFromContext(context);
162162
DECORATE.afterStart(span);

0 commit comments

Comments
 (0)