Skip to content

Commit 3c11163

Browse files
authored
Merge branch 'master' into jb/ddprof_1.23.0
2 parents fb3ebf8 + c0aff90 commit 3c11163

File tree

25 files changed

+736
-192
lines changed

25 files changed

+736
-192
lines changed

components/yaml/build.gradle.kts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
plugins {
2+
id("me.champeau.jmh")
3+
}
4+
5+
apply(from = "$rootDir/gradle/java.gradle")
6+
7+
jmh {
8+
version = "1.28"
9+
}
10+
11+
// https://repo1.maven.org/maven2/org/yaml/snakeyaml/2.4/snakeyaml-2.4.pom
12+
dependencies {
13+
implementation("org.yaml", "snakeyaml", "2.4")
14+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package datadog.yaml;
2+
3+
import java.io.FileInputStream;
4+
import java.io.IOException;
5+
import org.yaml.snakeyaml.Yaml;
6+
7+
public class YamlParser {
8+
// Supports clazz == null for default yaml parsing
9+
public static <T> T parse(String filePath, Class<T> clazz) throws IOException {
10+
Yaml yaml = new Yaml();
11+
try (FileInputStream fis = new FileInputStream(filePath)) {
12+
if (clazz == null) {
13+
return yaml.load(fis);
14+
} else {
15+
return yaml.loadAs(fis, clazz);
16+
}
17+
}
18+
}
19+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public final class Constants {
1616
public static final String[] BOOTSTRAP_PACKAGE_PREFIXES = {
1717
"datadog.slf4j",
1818
"datadog.json",
19+
"datadog.yaml",
1920
"datadog.context",
2021
"datadog.cli",
2122
"datadog.appsec.api",

dd-java-agent/agent-profiling/profiling-controller-jfr/src/main/resources/jfr/dd.jfp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ jdk.ThreadCPULoad#enabled=true
186186
jdk.ThreadCPULoad#period=10 s
187187
jdk.CPUTimeStampCounter#enabled=true
188188
jdk.CPUTimeStampCounter#period=beginChunk
189-
jdk.SystemProcess#enabled=true
189+
jdk.SystemProcess#enabled=false
190190
jdk.SystemProcess#period=endChunk
191191
jdk.NetworkUtilization#enabled=true
192192
jdk.NetworkUtilization#period=5 s

dd-java-agent/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ ext.generalShadowJarConfig = {
5959

6060
final String projectName = "${project.name}"
6161

62-
// Prevents conflict with other OkHttp instances, but don't relocate instrumentation
62+
// Prevents conflict with other instances, but doesn't relocate instrumentation
6363
if (!projectName.equals('instrumentation')) {
64+
relocate 'org.yaml.snakeyaml', 'datadog.snakeyaml'
6465
relocate 'okhttp3', 'datadog.okhttp3'
6566
relocate 'okio', 'datadog.okio'
6667
}

dd-java-agent/instrumentation/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ subprojects { Project subProj ->
5959
def name = "java$version.majorVersion"
6060
jdkCompile = "main_${name}Implementation"
6161
}
62+
configurations.muzzleBootstrap {
63+
exclude group: 'org.yaml', module : 'snakeyaml' // we vendor this in the agent jar
64+
}
6265
dependencies {
6366
// Apply common dependencies for instrumentation.
6467
implementation project(':dd-trace-api')

dd-java-agent/instrumentation/lettuce-5/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ muzzle {
1111
apply from: "$rootDir/gradle/java.gradle"
1212

1313
addTestSuiteForDir('latestDepTest', 'test')
14+
addTestSuiteExtendingForDir('latestDepForkedTest', 'latestDepTest', 'test')
1415

1516
dependencies {
1617
compileOnly group: 'io.lettuce', name: 'lettuce-core', version: '5.0.0.RELEASE'

dd-java-agent/instrumentation/lettuce-5/src/test/groovy/Lettuce5ClientTestBase.groovy

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ abstract class Lettuce5ClientTestBase extends VersionedNamingTestBase {
4242
RedisAsyncCommands<String, ?> asyncCommands
4343
RedisCommands<String, ?> syncCommands
4444

45+
@Override
46+
boolean useStrictTraceWrites() {
47+
// latest seems leaking continuations that terminates later hence the strict trace will discard our spans.
48+
!isLatestDepTest
49+
}
50+
51+
4552
def setup() {
4653
redisServer.start()
4754
println "Using redis: $redisServer.redisURI"

dd-java-agent/instrumentation/snakeyaml/build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ addTestSuiteForDir('latestDepTest', 'test')
1818

1919
dependencies {
2020
compileOnly group: 'org.yaml', name: 'snakeyaml', version: '1.33'
21-
testImplementation group: 'org.yaml', name: 'snakeyaml', version: '1.33'
21+
22+
testImplementation('org.yaml:snakeyaml') {
23+
version {
24+
strictly "[1.4, 2.0)"
25+
prefer '1.33'
26+
}
27+
}
2228

2329
latestDepTestImplementation group: 'org.yaml', name: 'snakeyaml', version: '1.+'
2430
}

dd-java-agent/testing/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ excludedClassesCoverage += [
3838
'datadog.trace.agent.test.TestProfilingContextIntegration.TestQueueTiming'
3939
]
4040

41+
configurations.api {
42+
exclude group: 'org.yaml', module: 'snakeyaml' // we vendor this in the agent jar
43+
}
44+
4145
dependencies {
4246
api libs.bytebuddy
4347
api libs.bytebuddyagent

0 commit comments

Comments
 (0)