Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dd-java-agent/agent-jmxfetch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ plugins {
apply from: "$rootDir/gradle/java.gradle"

dependencies {
api('com.datadoghq:jmxfetch:0.49.8') {
api('com.datadoghq:jmxfetch:0.52.0') {
exclude group: 'org.slf4j', module: 'slf4j-api'
exclude group: 'org.slf4j', module: 'slf4j-jdk14'
exclude group: 'com.beust', module: 'jcommander'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
exclude group: 'com.fasterxml.jackson.jr', module: 'jackson-jr-objects'
// we use snakeyaml-engine instead of legacy library
exclude group: 'org.yaml', module: 'snakeyaml'
}
api libs.slf4j
api project(':internal-api')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package datadog.trace.agent.jmxfetch;

import java.io.InputStream;

/**
* We map the legacy {@code org.yaml.snakeyaml.Yaml} class to this substitute class at build time to
* keep the GraalVM native-image builder happy. JmxFetch has a solitary reference to the class, but
* it's never called because JMXFetch discovers the embedded snakeyaml-engine library and uses that.
*/
public class LegacyYaml {
public <T> T load(InputStream in) {
throw new UnsupportedOperationException();
}

public String dump(Object data) {
throw new UnsupportedOperationException();
}
}
3 changes: 2 additions & 1 deletion dd-java-agent/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def generalShadowJarConfig(ShadowJar shadowJarTask) {
// Prevents conflict with other instances, but doesn't relocate instrumentation
if (!projectName.equals('instrumentation')) {
relocate 'org.snakeyaml.engine', 'datadog.snakeyaml.engine'
relocate 'org.yaml.snakeyaml.Yaml', 'datadog.trace.agent.jmxfetch.LegacyYaml'
relocate 'okhttp3', 'datadog.okhttp3'
relocate 'okio', 'datadog.okio'

Expand Down Expand Up @@ -467,7 +468,7 @@ tasks.register('checkAgentJarSize') {
doLast {
// Arbitrary limit to prevent unintentional increases to the agent jar size
// Raise or lower as required
assert tasks.named("shadowJar", ShadowJar).get().archiveFile.get().getAsFile().length() <= 32 * 1024 * 1024
assert tasks.named("shadowJar", ShadowJar).get().archiveFile.get().getAsFile().length() <= 33 * 1024 * 1024
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 thought: ‏I guess it can only go bigger over time 😓

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do have a plan to trim back a few things :)

}

dependsOn "shadowJar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ public static void onEnter(@Advice.Argument(value = 0, readOnly = false) String[
+ "com.datadog.profiling.controller.openjdk.events.QueueTimeEvent:build_time,"
+ "com.datadog.profiling.controller.openjdk.events.TimelineEvent:build_time,"
+ "com.datadog.profiling.controller.openjdk.events.SmapEntryEvent:build_time,"
+ "com.datadog.profiling.controller.openjdk.events.SmapEntryFactory$SmapParseErrorEvent:build_time,"
+ "com.datadog.profiling.ddprof.JavaProfilerLoader:run_time,"
+ "com.datadoghq.profiler.ThreadContext:run_time,"
+ "com.datadoghq.profiler.BufferWriter:run_time,"
+ "com.datadoghq.profiler.BufferWriter8:run_time,"
Expand Down Expand Up @@ -133,11 +131,13 @@ public static void onEnter(@Advice.Argument(value = 0, readOnly = false) String[
+ "datadog.trace.bootstrap.benchmark.StaticEventLogger:build_time,"
+ "datadog.trace.bootstrap.blocking.BlockingExceptionHandler:build_time,"
+ "datadog.trace.bootstrap.InstrumentationErrors:build_time,"
+ "datadog.trace.bootstrap.instrumentation.java.concurrent.AsyncResultExtensions$CompletableAsyncResultExtension:build_time,"
+ "datadog.trace.bootstrap.instrumentation.java.concurrent.AsyncResultExtensions$1:build_time,"
+ "datadog.trace.bootstrap.instrumentation.java.concurrent.AsyncResultExtensions:build_time,"
+ "datadog.trace.bootstrap.instrumentation.java.concurrent.ConcurrentState:build_time,"
+ "datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter:build_time,"
+ "datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter$ExcludeType:build_time,"
+ "datadog.trace.bootstrap.instrumentation.java.concurrent.QueueTimeHelper:build_time,"
+ "datadog.trace.bootstrap.instrumentation.java.concurrent.QueueTimerHelper:build_time,"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how you knew these had to be updated?

Copy link
Copy Markdown
Contributor Author

@mcculls mcculls Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While testing this locally I ran the smoke tests on a variety of GraalVM distros - one obscure version (23) flagged the missing wrapper class - I then noticed that a couple of other entries were stale and referred to non-existent classes and could be dropped :)

So this change doesn't affect supported versions, it's just clean-up I found during additional local testing

+ "datadog.trace.bootstrap.instrumentation.java.concurrent.QueueTimerHelper$RateLimiterHolder:run_time,"
+ "datadog.trace.bootstrap.instrumentation.java.concurrent.TPEHelper:build_time,"
+ "datadog.trace.bootstrap.instrumentation.jfr.exceptions.ExceptionCountEvent:build_time,"
Expand Down
Loading