Skip to content

Commit 4984a98

Browse files
authored
Merge branch 'master' into alejandro.gonzalez/APPSEC-56455
2 parents 58bba68 + 40f8224 commit 4984a98

File tree

123 files changed

+1879
-1462
lines changed

Some content is hidden

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

123 files changed

+1879
-1462
lines changed

.github/workflows/analyze-changes.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ jobs:
2929
dd_app_key: ${{ secrets.DATADOG_APP_KEY_STAGING }}
3030
dd_api_key: ${{ secrets.DATADOG_API_KEY_STAGING }}
3131
dd_site: "datad0g.com"
32-
dd_service: "dd-trace-java"
33-
dd_env: "ci"
3432
cpu_count: 2
3533
enable_performance_statistics: false
3634

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -755,12 +755,13 @@ private static synchronized void registerSmapEntryEvent() {
755755
"com.datadog.profiling.controller.openjdk.events.SmapEntryFactory");
756756
final Method registerMethod = smapFactoryClass.getMethod("registerEvents");
757757
registerMethod.invoke(null);
758-
} catch (final NoClassDefFoundError
758+
} catch (final NoSuchMethodException
759+
| NoClassDefFoundError
759760
| ClassNotFoundException
760-
| UnsupportedClassVersionError ignored) {
761+
| UnsupportedClassVersionError
762+
| IllegalAccessException
763+
| InvocationTargetException ignored) {
761764
log.debug("Smap entry scraping not supported");
762-
} catch (final Throwable ex) {
763-
log.error("Unable to initialize smap entry scraping", ex);
764765
}
765766
}
766767

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ConcurrentState.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import datadog.trace.bootstrap.ContextStore;
66
import datadog.trace.bootstrap.instrumentation.api.AgentScope;
7-
import datadog.trace.bootstrap.instrumentation.api.AgentTracer;
87
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
98
import org.slf4j.Logger;
109
import org.slf4j.LoggerFactory;
@@ -32,7 +31,7 @@ private ConcurrentState() {}
3231
public static <K> ConcurrentState captureScope(
3332
ContextStore<K, ConcurrentState> contextStore, K key, AgentScope scope) {
3433
if (scope != null && scope.isAsyncPropagating()) {
35-
if (scope.span() instanceof AgentTracer.NoopAgentSpan) {
34+
if (!scope.span().isValid()) {
3635
return null;
3736
}
3837
final ConcurrentState state = contextStore.putIfAbsent(key, FACTORY);

dd-java-agent/agent-ci-visibility/gradle.lockfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ org.eclipse.jetty:jetty-http:9.4.56.v20240826=testCompileClasspath,testFixturesA
124124
org.eclipse.jetty:jetty-io:9.4.56.v20240826=testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
125125
org.eclipse.jetty:jetty-server:9.4.56.v20240826=testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
126126
org.eclipse.jetty:jetty-util:9.4.56.v20240826=testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
127-
org.freemarker:freemarker:2.3.30=testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
127+
org.freemarker:freemarker:2.3.31=testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
128128
org.fusesource.jansi:jansi:2.1.0=zinc
129129
org.gmetrics:GMetrics:1.1=codenarc
130130
org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath

dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/LogProbe.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ private boolean evaluateCondition(CapturedContext capture, LogStatus status) {
555555
if (probeCondition == null) {
556556
return true;
557557
}
558-
long startTs = System.nanoTime();
559558
try {
560559
if (!probeCondition.execute(capture)) {
561560
return false;
@@ -564,9 +563,6 @@ private boolean evaluateCondition(CapturedContext capture, LogStatus status) {
564563
status.addError(new EvaluationError(ex.getExpr(), ex.getMessage()));
565564
status.setConditionErrors(true);
566565
return false;
567-
} finally {
568-
LOGGER.debug(
569-
"ProbeCondition for probe[{}] evaluated in {}ns", id, (System.nanoTime() - startTs));
570566
}
571567
return true;
572568
}

dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/ProfilingSystem.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import static datadog.trace.util.AgentThreadFactory.AgentThread.PROFILER_RECORDING_SCHEDULER;
2020

2121
import datadog.trace.api.Platform;
22-
import datadog.trace.api.profiling.ProfilingListenersRegistry;
2322
import datadog.trace.api.profiling.ProfilingSnapshot;
2423
import datadog.trace.api.profiling.RecordingData;
2524
import datadog.trace.api.profiling.RecordingDataListener;
@@ -265,7 +264,6 @@ public void snapshot(boolean onShutdown) {
265264
recording.snapshot(
266265
lastSnapshot,
267266
onShutdown ? ProfilingSnapshot.Kind.ON_SHUTDOWN : ProfilingSnapshot.Kind.PERIODIC);
268-
ProfilingListenersRegistry.getHost(ProfilingSnapshot.class).fireOnData(recordingData);
269267
log.debug("Snapshot created: {}", recordingData);
270268
if (recordingData != null) {
271269
// To make sure that we don't get data twice, we say that the next start should be

dd-java-agent/agent-profiling/profiling-ddprof/gradle.lockfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ch.qos.logback:logback-classic:1.2.3=testCompileClasspath,testRuntimeClasspath
55
ch.qos.logback:logback-core:1.2.3=testCompileClasspath,testRuntimeClasspath
66
com.beust:jcommander:1.78=testRuntimeClasspath
77
com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
8-
com.datadoghq:ddprof:1.18.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
8+
com.datadoghq:ddprof:1.19.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
99
com.github.javaparser:javaparser-core:3.25.1=testCompileClasspath,testRuntimeClasspath
1010
com.github.spotbugs:spotbugs-annotations:4.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
1111
com.github.spotbugs:spotbugs-annotations:4.7.3=spotbugs

dd-java-agent/instrumentation/akka-concurrent/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaActorCellInstrumentation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
55
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeScope;
66
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan;
7+
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan;
78
import static java.util.Collections.singletonMap;
89
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
910

@@ -13,7 +14,6 @@
1314
import datadog.trace.agent.tooling.InstrumenterModule;
1415
import datadog.trace.bootstrap.InstrumentationContext;
1516
import datadog.trace.bootstrap.instrumentation.api.AgentScope;
16-
import datadog.trace.bootstrap.instrumentation.api.AgentTracer;
1717
import datadog.trace.bootstrap.instrumentation.java.concurrent.AdviceUtils;
1818
import datadog.trace.bootstrap.instrumentation.java.concurrent.State;
1919
import java.util.Map;
@@ -72,11 +72,11 @@ public static AgentScope enter(
7272
return null;
7373
}
7474
// If there is a noop span in the active scope, we can clean all the way to this scope
75-
if (activeSpan() instanceof AgentTracer.NoopAgentSpan) {
75+
if (activeSpan() == noopSpan()) {
7676
return activeScope;
7777
}
7878
// Create an active scope with a noop span, and clean all the way to the previous scope
79-
localScope = activateSpan(AgentTracer.NoopAgentSpan.INSTANCE, false);
79+
localScope = activateSpan(noopSpan(), false);
8080
return activeScope;
8181
}
8282

dd-java-agent/instrumentation/akka-concurrent/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaMailboxInstrumentation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
55
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeScope;
66
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan;
7+
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan;
78
import static java.util.Collections.singletonList;
89
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
910

@@ -12,7 +13,6 @@
1213
import datadog.trace.agent.tooling.Instrumenter;
1314
import datadog.trace.agent.tooling.InstrumenterModule;
1415
import datadog.trace.bootstrap.instrumentation.api.AgentScope;
15-
import datadog.trace.bootstrap.instrumentation.api.AgentTracer;
1616
import datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter;
1717
import java.util.Collection;
1818
import java.util.EnumMap;
@@ -69,11 +69,11 @@ public static AgentScope enter() {
6969
return null;
7070
}
7171
// If there is a noop span in the active scope, we can clean all the way to this scope
72-
if (activeSpan() instanceof AgentTracer.NoopAgentSpan) {
72+
if (activeSpan() == noopSpan()) {
7373
return activeScope;
7474
}
7575
// Create an active scope with a noop span, and clean all the way to the previous scope
76-
activateSpan(AgentTracer.NoopAgentSpan.INSTANCE, false);
76+
activateSpan(noopSpan(), false);
7777
return activeScope;
7878
}
7979

dd-java-agent/instrumentation/akka-http/akka-http-10.6/gradle.lockfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestR
5757
com.squareup.okio:okio:1.17.5=compileClasspath,csiCompileClasspath,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
5858
com.swoval:file-tree-views:2.1.10=zinc
5959
com.thoughtworks.qdox:qdox:1.12.1=latestDepTestRuntimeClasspath,testRuntimeClasspath
60-
com.typesafe.akka:akka-actor_2.13:2.10.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
60+
com.typesafe.akka:akka-actor_2.13:2.10.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
6161
com.typesafe.akka:akka-actor_2.13:2.9.0=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath
6262
com.typesafe.akka:akka-http-core_2.13:10.6.0=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath
6363
com.typesafe.akka:akka-http-core_2.13:10.7.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
@@ -69,10 +69,10 @@ com.typesafe.akka:akka-http_2.13:10.6.0=main_java11CompileClasspath,testCompileC
6969
com.typesafe.akka:akka-http_2.13:10.7.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
7070
com.typesafe.akka:akka-parsing_2.13:10.6.0=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath
7171
com.typesafe.akka:akka-parsing_2.13:10.7.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
72-
com.typesafe.akka:akka-pki_2.13:2.10.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
73-
com.typesafe.akka:akka-protobuf-v3_2.13:2.10.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
72+
com.typesafe.akka:akka-pki_2.13:2.10.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
73+
com.typesafe.akka:akka-protobuf-v3_2.13:2.10.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
7474
com.typesafe.akka:akka-protobuf-v3_2.13:2.9.0=testCompileClasspath,testRuntimeClasspath
75-
com.typesafe.akka:akka-stream_2.13:2.10.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
75+
com.typesafe.akka:akka-stream_2.13:2.10.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
7676
com.typesafe.akka:akka-stream_2.13:2.9.0=testCompileClasspath,testRuntimeClasspath
7777
com.typesafe:config:1.4.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath
7878
commons-codec:commons-codec:1.15=spotbugs

dd-java-agent/instrumentation/apache-httpcore-5/gradle.lockfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ org.apache.httpcomponents.client5:httpclient5:5.1.3=spotbugs
7272
org.apache.httpcomponents.core5:httpcore5-h2:5.1.3=spotbugs
7373
org.apache.httpcomponents.core5:httpcore5:5.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
7474
org.apache.httpcomponents.core5:httpcore5:5.1.3=spotbugs
75-
org.apache.httpcomponents.core5:httpcore5:5.3.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
75+
org.apache.httpcomponents.core5:httpcore5:5.3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
7676
org.apache.logging.log4j:log4j-api:2.19.0=spotbugs
7777
org.apache.logging.log4j:log4j-core:2.19.0=spotbugs
7878
org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath

0 commit comments

Comments
 (0)