Skip to content

Commit 24451a3

Browse files
committed
re enable advice for tracing, and check earlier if work is not needed
1 parent de39ff9 commit 24451a3

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RouteImplInstrumentation.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public boolean isApplicable(Set<TargetSystem> enabledSystems) {
3737
postProcessorFactory = IastPostProcessorFactory.INSTANCE;
3838
return true;
3939
}
40-
return enabledSystems.contains(TargetSystem.APPSEC);
40+
return enabledSystems.contains(TargetSystem.TRACING)
41+
|| enabledSystems.contains(TargetSystem.APPSEC);
4142
}
4243

4344
@Override

dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RouteUpdateHelper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public static void updateRouteFromContext(
4141
final RoutingContext routingContext,
4242
final AgentSpan parentSpan,
4343
final AgentSpan handlerSpan) {
44+
if (parentSpan == null && handlerSpan == null) {
45+
return;
46+
}
4447
if (routingContext.currentRoute() == null) {
4548
return;
4649
}
@@ -60,14 +63,11 @@ public static void updateRouteFromContext(
6063
updateRoute(routingContext, method, path, parentSpan, handlerSpan);
6164
}
6265

63-
public static boolean shouldUpdateRoute(
66+
private static boolean shouldUpdateRoute(
6467
final RoutingContext routingContext,
6568
final AgentSpan parentSpan,
6669
final AgentSpan handlerSpan,
6770
final String path) {
68-
if (parentSpan == null && handlerSpan == null) {
69-
return false;
70-
}
7171
final String currentRoute = routingContext.get(ROUTE_CONTEXT_KEY);
7272
if (currentRoute != null && currentRoute.equals(path)) {
7373
return false;

dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteImplInstrumentation.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public boolean isApplicable(Set<TargetSystem> enabledSystems) {
3535
postProcessorFactory = IastPostProcessorFactory.INSTANCE;
3636
return true;
3737
}
38-
return enabledSystems.contains(TargetSystem.APPSEC);
38+
return enabledSystems.contains(TargetSystem.TRACING)
39+
|| enabledSystems.contains(TargetSystem.APPSEC);
3940
}
4041

4142
@Override

dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteUpdateHelper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public static void updateRouteFromContext(
4141
final RoutingContext routingContext,
4242
final AgentSpan parentSpan,
4343
final AgentSpan handlerSpan) {
44+
if (parentSpan == null && handlerSpan == null) {
45+
return;
46+
}
4447
if (routingContext.currentRoute() == null) {
4548
return;
4649
}
@@ -62,14 +65,11 @@ public static void updateRouteFromContext(
6265
updateRoute(routingContext, method, path, parentSpan, handlerSpan);
6366
}
6467

65-
public static boolean shouldUpdateRoute(
68+
private static boolean shouldUpdateRoute(
6669
final RoutingContext routingContext,
6770
final AgentSpan parentSpan,
6871
final AgentSpan handlerSpan,
6972
final String path) {
70-
if (parentSpan == null && handlerSpan == null) {
71-
return false;
72-
}
7373
final String currentRoute = routingContext.get(ROUTE_CONTEXT_KEY);
7474
if (currentRoute != null && currentRoute.equals(path)) {
7575
return false;

0 commit comments

Comments
 (0)