Skip to content
Merged
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 @@ -7,6 +7,7 @@
import static datadog.trace.instrumentation.vertx_3_4.server.VertxDecorator.DECORATE;

import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
import datadog.trace.bootstrap.instrumentation.api.Tags;
import io.vertx.core.Handler;
import io.vertx.ext.web.RoutingContext;

Expand All @@ -29,7 +30,10 @@ public void handle(final Void event) {
actual.handle(event);
}
} finally {
if (path != null && parentSpan != null) {
if (path != null
&& parentSpan != null
// do not override route with a "/" if it's already set (it's probably more meaningful)
&& !(path.equals("/") && parentSpan.getTag(Tags.HTTP_ROUTE) != null)) {
HTTP_RESOURCE_DECORATOR.withRoute(
parentSpan, routingContext.request().rawMethod(), path, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import static datadog.trace.instrumentation.vertx_4_0.server.VertxDecorator.DECORATE;

import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
import datadog.trace.bootstrap.instrumentation.api.Tags;
import io.vertx.core.Handler;
import io.vertx.ext.web.RoutingContext;

Expand All @@ -29,7 +30,10 @@ public void handle(final Void event) {
actual.handle(event);
}
} finally {
if (path != null && parentSpan != null) {
if (path != null
&& parentSpan != null
// do not override route with a "/" if it's already set (it's probably more meaningful)
&& !(path.equals("/") && parentSpan.getTag(Tags.HTTP_ROUTE) != null)) {
HTTP_RESOURCE_DECORATOR.withRoute(
parentSpan, routingContext.request().method().name(), path, true);
}
Expand Down
Loading