Skip to content

Commit e570ee4

Browse files
Merge branch 'master' into sezen.leblay/apm-metrics-tag
2 parents 07f3244 + d2f5bb4 commit e570ee4

File tree

646 files changed

+2706
-2464
lines changed

Some content is hidden

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

646 files changed

+2706
-2464
lines changed

.gitlab-ci.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,12 @@ populate_dep_cache:
318318
CACHE_TYPE: "base"
319319
- GRADLE_TARGET: ":profilingTest"
320320
CACHE_TYPE: "profiling"
321-
# FIXME: Gitlab doesn't support s3 based caches >5GB. Fixed in Gitlab 17.5
322-
# See: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/26921#note_2132307223
323-
# - GRADLE_TARGET: ":instrumentationTest"
324-
# CACHE_TYPE: "inst"
325-
# - GRADLE_TARGET: ":instrumentationLatestDepTest"
326-
# CACHE_TYPE: "latestdep"
327-
# - GRADLE_TARGET: ":smokeTest"
328-
# CACHE_TYPE: "smoke"
321+
- GRADLE_TARGET: ":instrumentationTest"
322+
CACHE_TYPE: "inst"
323+
- GRADLE_TARGET: ":instrumentationLatestDepTest"
324+
CACHE_TYPE: "latestdep"
325+
- GRADLE_TARGET: ":smokeTest"
326+
CACHE_TYPE: "smoke"
329327

330328
publish-artifacts-to-s3:
331329
image: registry.ddbuild.io/images/mirror/amazon/aws-cli:2.4.29
@@ -640,7 +638,7 @@ test_inst_latest:
640638
extends: .test_job_with_test_agent
641639
variables:
642640
GRADLE_TARGET: ":instrumentationLatestDepTest"
643-
CACHE_TYPE: "latestDep"
641+
CACHE_TYPE: "latestdep"
644642
parallel:
645643
matrix:
646644
- testJvm: ["8", "17", "21", "25"] # the latest "stable" version is LTS v25

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ plugins {
1313
id("com.gradleup.shadow") version "8.3.6" apply false
1414
id("me.champeau.jmh") version "0.7.3" apply false
1515
id("org.gradle.playframework") version "0.13" apply false
16+
kotlin("jvm") version libs.versions.kotlin.plugin apply false
1617
}
1718

1819
description = "dd-trace-java"

buildSrc/src/main/groovy/InstrumentPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class InstrumentPlugin implements Plugin<Project> {
3535
InstrumentExtension extension = project.extensions.create('instrument', InstrumentExtension)
3636

3737
project.tasks.matching {
38-
it.name in ['compileJava', 'compileScala', 'compileKotlin', 'compileGroovy'] ||
38+
it.name in ['compileJava', 'compileScala', 'compileGroovy'] ||
3939
it.name =~ /compileMain_.+Java/
4040
}.all {
4141
AbstractCompile compileTask = it as AbstractCompile

communication/gradle.lockfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ com.github.jnr:jnr-x86asm:1.0.2=compileClasspath,runtimeClasspath,testCompileCla
3131
com.github.spotbugs:spotbugs-annotations:4.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
3232
com.github.spotbugs:spotbugs-annotations:4.7.3=spotbugs
3333
com.github.spotbugs:spotbugs:4.7.3=spotbugs
34-
com.github.stefanbirkner:system-rules:1.19.0=testCompileClasspath,testRuntimeClasspath
3534
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
3635
com.google.code.gson:gson:2.9.1=spotbugs
3736
com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
@@ -47,7 +46,6 @@ info.picocli:picocli:4.6.3=testRuntimeClasspath
4746
io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath
4847
jaxen:jaxen:1.2.0=spotbugs
4948
jline:jline:2.14.6=testRuntimeClasspath
50-
junit:junit-dep:4.11=testCompileClasspath,testRuntimeClasspath
5149
junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath
5250
net.bytebuddy:byte-buddy-agent:1.17.7=testCompileClasspath,testRuntimeClasspath
5351
net.bytebuddy:byte-buddy:1.17.7=testCompileClasspath,testRuntimeClasspath

components/environment/src/main/java/datadog/environment/EnvironmentVariables.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@
1616
public final class EnvironmentVariables {
1717
private EnvironmentVariables() {}
1818

19+
public static class EnvironmentVariablesProvider {
20+
public String get(String name) {
21+
return System.getenv(name);
22+
}
23+
24+
public Map<String, String> getAll() {
25+
return System.getenv();
26+
}
27+
}
28+
29+
// Make it accessible from tests.
30+
public static EnvironmentVariablesProvider provider = new EnvironmentVariablesProvider();
31+
1932
/**
2033
* Gets an environment variable value.
2134
*
@@ -41,7 +54,7 @@ public static String getOrDefault(String name, String defaultValue) {
4154
return defaultValue;
4255
}
4356
try {
44-
String value = System.getenv(name);
57+
String value = provider.get(name);
4558
return value == null ? defaultValue : value;
4659
} catch (SecurityException e) {
4760
return defaultValue;
@@ -56,7 +69,7 @@ public static String getOrDefault(String name, String defaultValue) {
5669
*/
5770
public static Map<String, String> getAll() {
5871
try {
59-
return unmodifiableMap(new HashMap<>(System.getenv()));
72+
return unmodifiableMap(new HashMap<>(provider.getAll()));
6073
} catch (SecurityException e) {
6174
return emptyMap();
6275
}

dd-java-agent/agent-aiguard/gradle.lockfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath
2626
com.github.spotbugs:spotbugs-annotations:4.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
2727
com.github.spotbugs:spotbugs-annotations:4.7.3=spotbugs
2828
com.github.spotbugs:spotbugs:4.7.3=spotbugs
29-
com.github.stefanbirkner:system-rules:1.19.0=testCompileClasspath,testRuntimeClasspath
3029
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
3130
com.google.code.gson:gson:2.9.1=spotbugs
3231
com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
@@ -41,7 +40,6 @@ info.picocli:picocli:4.6.3=testRuntimeClasspath
4140
io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath
4241
jaxen:jaxen:1.2.0=spotbugs
4342
jline:jline:2.14.6=testRuntimeClasspath
44-
junit:junit-dep:4.11=testCompileClasspath,testRuntimeClasspath
4543
junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath
4644
net.bytebuddy:byte-buddy-agent:1.17.7=testCompileClasspath,testRuntimeClasspath
4745
net.bytebuddy:byte-buddy:1.17.7=testCompileClasspath,testRuntimeClasspath

dd-java-agent/agent-bootstrap/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
apply from: "$rootDir/gradle/java.gradle"
1010
apply plugin: "idea"
1111

12-
tasks.named("compileJava", JavaCompile).configure {
12+
tasks.named("compileJava", JavaCompile) {
1313
configureCompiler(it, 8, JavaVersion.VERSION_1_8, "Need access to sun.* packages")
1414
}
1515

dd-java-agent/agent-bootstrap/gradle.lockfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ com.github.jnr:jnr-x86asm:1.0.2=jmhRuntimeClasspath,testRuntimeClasspath
2424
com.github.spotbugs:spotbugs-annotations:4.2.0=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
2525
com.github.spotbugs:spotbugs-annotations:4.7.3=spotbugs
2626
com.github.spotbugs:spotbugs:4.7.3=spotbugs
27-
com.github.stefanbirkner:system-rules:1.19.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
2827
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
2928
com.google.code.gson:gson:2.9.1=spotbugs
3029
com.google.guava:guava:20.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
@@ -44,7 +43,6 @@ io.sqreen:libsqreen:17.1.0=jmhRuntimeClasspath,testRuntimeClasspath
4443
javax.servlet:javax.servlet-api:3.1.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
4544
jaxen:jaxen:1.2.0=spotbugs
4645
jline:jline:2.14.6=jmhRuntimeClasspath,testRuntimeClasspath
47-
junit:junit-dep:4.11=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
4846
junit:junit:4.13.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
4947
net.bytebuddy:byte-buddy-agent:1.17.7=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
5048
net.bytebuddy:byte-buddy:1.17.7=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath

dd-java-agent/agent-builder/gradle.lockfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath
2424
com.github.spotbugs:spotbugs-annotations:4.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
2525
com.github.spotbugs:spotbugs-annotations:4.7.3=spotbugs
2626
com.github.spotbugs:spotbugs:4.7.3=spotbugs
27-
com.github.stefanbirkner:system-rules:1.19.0=testCompileClasspath,testRuntimeClasspath
2827
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
2928
com.google.code.gson:gson:2.9.1=spotbugs
3029
com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath
@@ -44,7 +43,6 @@ io.sqreen:libsqreen:17.1.0=testRuntimeClasspath
4443
javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath
4544
jaxen:jaxen:1.2.0=spotbugs
4645
jline:jline:2.14.6=testRuntimeClasspath
47-
junit:junit-dep:4.11=testCompileClasspath,testRuntimeClasspath
4846
junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath
4947
net.bytebuddy:byte-buddy-agent:1.17.7=compileClasspath,main_java11CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
5048
net.bytebuddy:byte-buddy:1.17.7=compileClasspath,main_java11CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath

dd-java-agent/agent-builder/src/test/groovy/datadog/trace/agent/test/DefaultInstrumenterForkedTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package datadog.trace.agent.test
22

3-
3+
import datadog.environment.EnvironmentVariables
44
import datadog.trace.agent.tooling.InstrumenterModule
55
import datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers
66
import datadog.trace.agent.tooling.bytebuddy.outline.TypePoolFacade
@@ -118,7 +118,7 @@ class DefaultInstrumenterForkedTest extends DDSpecification {
118118
def target = new TestDefaultInstrumenter(name, altName)
119119

120120
then:
121-
System.getenv("DD_INTEGRATION_${value}_ENABLED") == "true"
121+
EnvironmentVariables.get("DD_INTEGRATION_${value}_ENABLED") == "true"
122122
target.enabled == enabled
123123

124124
where:

0 commit comments

Comments
 (0)