Skip to content

Commit 0a1baef

Browse files
committed
WIP Reusing instrumentation name from instrumentation
1 parent 478bffa commit 0a1baef

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

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

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,16 @@ public Context extract(REQUEST_CARRIER carrier) {
135135
/**
136136
* Starts a span.
137137
*
138-
* @param instrumentationName The instrumentation creating the span.
139138
* @param carrier The request carrier.
140139
* @param context The parent context of the span to create.
141140
* @return A new context bundling the span, child of the given parent context.
142141
*/
143142
public Context startSpan(
144-
String instrumentationName,
143+
String unused, // TODO Remove
145144
REQUEST_CARRIER carrier,
146145
Context context) { // TODO Rename "context" to "parent"?
146+
String instrumentationName =
147+
instrumentationNames().length == 0 ? "http-server" : instrumentationNames()[0];
147148
AgentSpanContext.Extracted spanContext = getExtractedSpanContext(context);
148149
AgentSpan span =
149150
tracer()
@@ -397,18 +398,6 @@ public AgentSpan onResponse(final AgentSpan span, final RESPONSE response) {
397398
return span;
398399
}
399400

400-
// @Override
401-
// public Span onError(final Span span, final Throwable throwable) {
402-
// assert span != null;
403-
// // FIXME
404-
// final Object status = span.getTag("http.status");
405-
// if (status == null || status.equals(200)) {
406-
// // Ensure status set correctly
407-
// span.setTag("http.status", 500);
408-
// }
409-
// return super.onError(span, throwable);
410-
// }
411-
412401
private AgentSpanContext.Extracted callIGCallbackStart(final AgentSpanContext.Extracted context) {
413402
AgentTracer.TracerAPI tracer = tracer();
414403
Supplier<Flow<Object>> startedCbAppSec =

0 commit comments

Comments
 (0)