Skip to content

Commit 23f1013

Browse files
authored
Merge branch 'master' into mtoff/stable_cfg_2
2 parents cffcc17 + 8adba3f commit 23f1013

155 files changed

Lines changed: 2392 additions & 1463 deletions

File tree

Some content is hidden

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

.circleci/config.continue.yml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ instrumentation_modules: &instrumentation_modules "dd-java-agent/instrumentation
3636
debugger_modules: &debugger_modules "dd-java-agent/agent-debugger|dd-java-agent/agent-bootstrap|dd-java-agent/agent-builder|internal-api|communication|dd-trace-core"
3737
profiling_modules: &profiling_modules "dd-java-agent/agent-profiling"
3838

39-
default_system_tests_commit: &default_system_tests_commit 1de04c42cbd9783432258004e46eb5982bbc9fe5
39+
default_system_tests_commit: &default_system_tests_commit 55cc62fb333b8de1466f8a0ecfdfa55fe9f57031
4040

4141
parameters:
4242
nightly:

.gitlab-ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ variables:
2323
DEPENDENCY_CACHE_POLICY: pull
2424
BUILD_CACHE_POLICY: pull
2525
GRADLE_VERSION: "8.4" # must match gradle-wrapper.properties
26-
MAVEN_REPOSITORY_PROXY: "https://artifactual.us1.prod.dog/repository/maven-central/"
26+
MAVEN_REPOSITORY_PROXY: "http://artifactual.artifactual.all-clusters.local-dc.fabric.dog:8081/repository/maven-central/"
27+
GRADLE_PLUGIN_PROXY: "http://artifactual.artifactual.all-clusters.local-dc.fabric.dog:8081/repository/gradle-plugin-portal-proxy/"
2728
JAVA_BUILD_IMAGE_VERSION: "v25.01"
2829
REPO_NOTIFICATION_CHANNEL: "#apm-java-escalations"
2930
PROFILE_TESTS:
@@ -75,7 +76,7 @@ default:
7576
policy: $BUILD_CACHE_POLICY
7677
before_script:
7778
- export GRADLE_USER_HOME=`pwd`/.gradle
78-
- export GRADLE_ARGS=" --build-cache --stacktrace --no-daemon --parallel --max-workers=$GRADLE_WORKERS -PmavenRepositoryProxy=$MAVEN_REPOSITORY_PROXY"
79+
- export GRADLE_ARGS=" --build-cache --stacktrace --no-daemon --parallel --max-workers=$GRADLE_WORKERS -PmavenRepositoryProxy=$MAVEN_REPOSITORY_PROXY -PgradlePluginProxy=$GRADLE_PLUGIN_PROXY"
7980
- *normalize_node_index
8081
# for weird reasons, gradle will always "chmod 700" the .gradle folder
8182
# with Gitlab caching, .gradle is always owned by root and thus gradle's chmod invocation fails

build.gradle

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ description = 'dd-trace-java'
3232

3333
def isCI = System.getenv("CI") != null
3434

35+
apply from: "$rootDir/gradle/repositories.gradle"
3536
apply from: "$rootDir/gradle/scm.gradle"
3637
spotless {
3738
// only resolve the spotless dependencies once in the build
@@ -79,12 +80,6 @@ allprojects {
7980
}
8081
}
8182

82-
repositories {
83-
mavenLocal()
84-
mavenCentral()
85-
gradlePluginPortal()
86-
}
87-
8883
tasks.register("latestDepTest")
8984

9085
nexusPublishing {

buildSrc/build.gradle.kts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ gradlePlugin {
2222
}
2323
}
2424

25-
repositories {
26-
mavenLocal()
27-
mavenCentral()
28-
gradlePluginPortal()
25+
apply {
26+
from("$rootDir/../gradle/repositories.gradle")
2927
}
3028

3129
dependencies {

buildSrc/call-site-instrumentation-plugin/build.gradle.kts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ spotless {
2424
}
2525
}
2626

27-
repositories {
28-
mavenLocal()
29-
mavenCentral()
30-
gradlePluginPortal()
27+
apply {
28+
from("$rootDir/../gradle/repositories.gradle")
3129
}
3230

3331
dependencies {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ public static void start(
250250
setSystemPropertyDefault(
251251
propertyNameToSystemPropertyName("integration.kafka.enabled"), "true");
252252

253+
if (Config.get().isDataJobsOpenLineageEnabled()) {
254+
setSystemPropertyDefault(
255+
propertyNameToSystemPropertyName("integration.spark-openlineage.enabled"), "true");
256+
}
257+
253258
String javaCommand = System.getProperty("sun.java.command");
254259
String dataJobsCommandPattern = Config.get().getDataJobsCommandPattern();
255260
if (!isDataJobsSupported(javaCommand, dataJobsCommandPattern)) {

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ public Object apply(Object result, AgentSpan span) {
6161
}
6262
return null;
6363
}
64+
}
6465

65-
private <T> BiConsumer<T, Throwable> finishSpan(AgentSpan span) {
66-
return (o, throwable) -> {
67-
if (throwable != null) {
68-
span.addThrowable(
69-
throwable instanceof ExecutionException || throwable instanceof CompletionException
70-
? throwable.getCause()
71-
: throwable);
72-
}
73-
span.finish();
74-
};
75-
}
66+
public static <T> BiConsumer<T, Throwable> finishSpan(AgentSpan span) {
67+
return (o, throwable) -> {
68+
if (throwable != null) {
69+
span.addThrowable(
70+
throwable instanceof ExecutionException || throwable instanceof CompletionException
71+
? throwable.getCause()
72+
: throwable);
73+
}
74+
span.finish();
75+
};
7676
}
7777
}

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
buildscript {
22
repositories {
3+
mavenLocal()
4+
if (project.rootProject.hasProperty("gradlePluginProxy")) {
5+
maven {
6+
url project.rootProject.property("gradlePluginProxy")
7+
allowInsecureProtocol true
8+
}
9+
}
10+
if (project.rootProject.hasProperty("mavenRepositoryProxy")) {
11+
maven {
12+
url project.rootProject.property("mavenRepositoryProxy")
13+
allowInsecureProtocol true
14+
}
15+
}
16+
gradlePluginPortal()
317
mavenCentral()
418
}
519

dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/test/ExecutionStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public boolean isModified(@Nonnull TestSourceData testSourceData) {
210210
.contains(sourcePath, lines.getStartLineNumber(), lines.getEndLineNumber());
211211

212212
} catch (Exception e) {
213-
LOGGER.error("Could not determine if {} was modified, assuming false", testSourceData, e);
213+
LOGGER.debug("Could not determine if {} was modified, assuming false", testSourceData, e);
214214
return false;
215215
}
216216
}

dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/CodeOriginInstrumentor.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
import static com.datadog.debugger.instrumentation.ASMHelper.ldc;
55
import static com.datadog.debugger.instrumentation.Types.DEBUGGER_CONTEXT_TYPE;
66
import static com.datadog.debugger.instrumentation.Types.STRING_TYPE;
7+
import static java.lang.Integer.parseInt;
78

89
import com.datadog.debugger.instrumentation.InstrumentationResult.Status;
10+
import com.datadog.debugger.probe.CodeOriginProbe;
911
import com.datadog.debugger.probe.ProbeDefinition;
1012
import datadog.trace.bootstrap.debugger.ProbeId;
1113
import java.util.List;
1214
import org.objectweb.asm.Type;
15+
import org.objectweb.asm.tree.AbstractInsnNode;
1316
import org.objectweb.asm.tree.InsnList;
17+
import org.objectweb.asm.tree.LabelNode;
1418

1519
public class CodeOriginInstrumentor extends Instrumentor {
1620
public CodeOriginInstrumentor(
@@ -26,11 +30,21 @@ public Status instrument() {
2630
InsnList insnList = new InsnList();
2731

2832
ldc(insnList, probeIds.get(0).getEncodedId());
29-
3033
invokeStatic(insnList, DEBUGGER_CONTEXT_TYPE, "codeOrigin", Type.VOID_TYPE, STRING_TYPE);
31-
32-
methodNode.instructions.insert(methodEnterLabel, insnList);
34+
methodNode.instructions.insert(findInsertionPoint(), insnList);
3335

3436
return InstrumentationResult.Status.INSTALLED;
3537
}
38+
39+
private AbstractInsnNode findInsertionPoint() {
40+
CodeOriginProbe probe = (CodeOriginProbe) definition;
41+
List<String> lines = probe.getLocation().getLines();
42+
if (!probe.entrySpanProbe() && lines != null && !lines.isEmpty()) {
43+
LabelNode lineLabel = classFileLines.getLineLabel(parseInt(lines.get(0)));
44+
if (lineLabel != null) {
45+
return lineLabel.getNext();
46+
}
47+
}
48+
return methodEnterLabel;
49+
}
3650
}

0 commit comments

Comments
 (0)