Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4cbca56
Pin system tests for release branch (#12142)
dd-octo-sts[bot] Aug 4, 2026
db887be
Skip latest broken Kafka Connect 7.x POMs (#12160) (#12172)
kaahos Aug 10, 2026
5b1dc07
ci: update one-pipeline to 1.2.0 (#12174)
PerfectSlayer Aug 10, 2026
3277e89
Bump ddprof to 1.49.0 (#12168) (#12173)
kaahos Aug 10, 2026
83d0540
🍒 11535 - Handle gracefully malformed flag evaluations (#12176)
sarahchen6 Aug 10, 2026
cd111ab
🍒 12203 - ci: update one-pipeline to 1.3.1 (#12206)
mhdatie Aug 13, 2026
93c577b
Add InstrumenterConfig.isDataStreamsEnabled() accessor
ericfirth Aug 26, 2026
e0c0c2d
Add TargetSystem.DATA_STREAMS and InstrumenterModule.DataStreams base…
ericfirth Aug 28, 2026
fc02467
Add isEnabled() test coverage for DataStreams
ericfirth Aug 28, 2026
c78e86e
Fix test isolation bug in testDataStreamsIsEnabledWhenDataStreamsEnab…
ericfirth Aug 28, 2026
7c3ddfe
Remove unused AfterEach import from InstrumenterModuleTest
ericfirth Aug 28, 2026
09bd612
Wire AgentInstaller.getEnabledSystems() to DATA_STREAMS target system
ericfirth Aug 28, 2026
9e82290
Add SamplingMechanism.DATA_STREAMS constant
ericfirth Aug 28, 2026
7f98b64
Fix DATA_STREAMS case formatting to match DATA_JOBS style
ericfirth Aug 28, 2026
76a263f
Swap kafka-clients-0.11 instrumentations to InstrumenterModule.DataSt…
ericfirth Aug 28, 2026
5b346fb
Suppress APM billing for DSM-only Kafka produce spans
ericfirth Aug 28, 2026
bc55491
Swap kafka-clients-3.8 instrumentations to InstrumenterModule.DataStr…
ericfirth Aug 28, 2026
4ef4238
Decouple DSM from APM tracing in kafka-clients-3.8 (produce and consu…
ericfirth Aug 28, 2026
a4b9ad5
chore: kafka-streams-0.11 DSM decoupling (base-class swap + suppression)
ericfirth Aug 28, 2026
bda034a
refactor: change kafka-streams-1.0 InternalTopologyBuilderInstrumenta…
ericfirth Aug 28, 2026
481223e
refactor: decouple kafka-connect-0.11 instrumentation from APM tracing
ericfirth Aug 28, 2026
c3eef89
Migrate InstrumenterConfigTest to JUnit 5 and add isDataStreamsEnable…
ericfirth Aug 28, 2026
e751428
Migrate SamplingMechanismTest to JUnit 5 and add DATA_STREAMS cases
ericfirth Aug 28, 2026
5f060a3
test: add JUnit 5 tests for AgentInstaller.getEnabledSystems() DATA_S…
ericfirth Aug 28, 2026
914974d
fix: suppress APM billing for DSM-only Kafka consume spans in kafka-c…
ericfirth Aug 28, 2026
54f1b80
Add tests for DSM billing suppression on kafka produce/consume spans
ericfirth Aug 28, 2026
fcb3092
fix: only force DSM-only USER_DROP when the Kafka span owns the local…
ericfirth Aug 28, 2026
3b2994c
fix: keep Kafka Code Origin instrumentation on the Tracing base class
ericfirth Aug 28, 2026
feba908
test: cover DSM-only sampling suppression for Kafka produce, consume …
ericfirth Aug 28, 2026
c067365
fix: suppress DSM-only Kafka poll-span billing gap and address code r…
ericfirth Aug 31, 2026
9043a04
fix: widen maybeDropForDataStreamsOnly visibility to satisfy Muzzle
ericfirth Sep 4, 2026
81a34b5
fix: never create a real span for DSM-only Kafka consume/produce paths
ericfirth Sep 4, 2026
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: 2 additions & 2 deletions .github/workflows/run-system-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ jobs:
needs:
- build
# If you change the following comment, update the pattern in the update_system_test_reference.sh script to match.
uses: DataDog/system-tests/.github/workflows/system-tests.yml@main # system tests are pinned on release branches only
uses: DataDog/system-tests/.github/workflows/system-tests.yml@20ec39676051d9eedf2fdcea17f716e7b89d3c10 # system tests are pinned on release branches only
permissions:
contents: read
id-token: write
packages: write
with:
library: java
# If you change the following comment, update the pattern in the update_system_test_reference.sh script to match.
ref: "main" # system tests are pinned on release branches only
ref: "20ec39676051d9eedf2fdcea17f716e7b89d3c10" # system tests are pinned on release branches only
binaries_artifact: binaries
desired_execution_time: 900 # 15 minutes
scenarios_groups: tracer-release
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,7 @@ publishing-gate:

configure_system_tests:
variables:
SYSTEM_TESTS_REF: "main" # system tests are pinned on release branches only
SYSTEM_TESTS_REF: "20ec39676051d9eedf2fdcea17f716e7b89d3c10" # system tests are pinned on release branches only
SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,simple_onboarding_appsec,docker-ssi,lib-injection"

create_key:
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/one-pipeline.locked.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DO NOT EDIT THIS FILE MANUALLY
# This file is auto-generated by automation.
include:
- remote: https://gitlab-templates.ddbuild.io/libdatadog/include/versions/1.1.0/one-pipeline.yml
- remote: https://gitlab-templates.ddbuild.io/libdatadog/include/versions/1.3.1/one-pipeline.yml
1 change: 1 addition & 0 deletions dd-java-agent/agent-installer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
compileOnly project(':products:metrics:metrics-lib')

testImplementation project(':dd-java-agent:testing')
testImplementation project(':utils:test-junit-utils')
}

tasks.named("compileMain_java11Java", JavaCompile) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ public static Set<InstrumenterModule.TargetSystem> getEnabledSystems() {
if (cfg.isUsmEnabled()) {
enabledSystems.add(InstrumenterModule.TargetSystem.USM);
}
if (cfg.isDataStreamsEnabled()) {
enabledSystems.add(InstrumenterModule.TargetSystem.DATA_STREAMS);
}
if (cfg.isLlmObsEnabled()) {
enabledSystems.add(InstrumenterModule.TargetSystem.LLMOBS);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package datadog.trace.agent.tooling;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import datadog.trace.agent.tooling.InstrumenterModule.TargetSystem;
import datadog.trace.test.junit.utils.config.WithConfig;
import datadog.trace.test.junit.utils.config.WithConfigExtension;
import java.util.Set;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

/**
* Tests for {@link AgentInstaller#getEnabledSystems()} to verify that it correctly includes target
* systems based on their corresponding configuration flags.
*/
@ExtendWith(WithConfigExtension.class)
class AgentInstallerGetEnabledSystemsTest {

/**
* Verifies that DATA_STREAMS target system is not included when data.streams.enabled is false
* (default).
*/
@Test
void dataStreamsNotIncludedWhenDisabled() {
Set<TargetSystem> enabledSystems = AgentInstaller.getEnabledSystems();
assertFalse(
enabledSystems.contains(TargetSystem.DATA_STREAMS),
"DATA_STREAMS should not be included when disabled");
}

/** Verifies that DATA_STREAMS target system is included when data.streams.enabled is true. */
@Test
@WithConfig(key = "data.streams.enabled", value = "true")
void dataStreamsIncludedWhenEnabled() {
Set<TargetSystem> enabledSystems = AgentInstaller.getEnabledSystems();
assertTrue(
enabledSystems.contains(TargetSystem.DATA_STREAMS),
"DATA_STREAMS should be included when enabled");
}

/** Verifies that USM target system is not included when usm.enabled is false (default). */
@Test
void usmNotIncludedWhenDisabled() {
Set<TargetSystem> enabledSystems = AgentInstaller.getEnabledSystems();
assertFalse(
enabledSystems.contains(TargetSystem.USM), "USM should not be included when disabled");
}

/** Verifies that USM target system is included when usm.enabled is true. */
@Test
@WithConfig(key = "usm.enabled", value = "true")
void usmIncludedWhenEnabled() {
Set<TargetSystem> enabledSystems = AgentInstaller.getEnabledSystems();
assertTrue(enabledSystems.contains(TargetSystem.USM), "USM should be included when enabled");
}

/** Verifies that LLMOBS target system is not included when llmobs.enabled is false (default). */
@Test
void llmobsNotIncludedWhenDisabled() {
Set<TargetSystem> enabledSystems = AgentInstaller.getEnabledSystems();
assertFalse(
enabledSystems.contains(TargetSystem.LLMOBS),
"LLMOBS should not be included when disabled");
}

/** Verifies that LLMOBS target system is included when llmobs.enabled is true. */
@Test
@WithConfig(key = "llmobs.enabled", value = "true")
void llmobsIncludedWhenEnabled() {
Set<TargetSystem> enabledSystems = AgentInstaller.getEnabledSystems();
assertTrue(
enabledSystems.contains(TargetSystem.LLMOBS), "LLMOBS should be included when enabled");
}
}
1 change: 1 addition & 0 deletions dd-java-agent/agent-tooling/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dependencies {
api libs.bytebuddyagent

testImplementation project(':dd-java-agent:testing')
testImplementation project(':utils:test-junit-utils')
testImplementation libs.bytebuddy
testImplementation group: 'com.google.guava', name: 'guava-testlib', version: '20.0'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public abstract class InstrumenterModule implements Instrumenter {
* <li>{@link TargetSystem#IAST iast}
* <li>{@link TargetSystem#CIVISIBILITY ci-visibility}
* <li>{@link TargetSystem#USM usm}
* <li>{@link TargetSystem#DATA_STREAMS data-streams}
* <li>{@link TargetSystem#CONTEXT_TRACKING context-tracking}
* <li>{@link TargetSystem#RASP rasp}
* </ul>
Expand All @@ -53,6 +54,7 @@ public enum TargetSystem {
CIVISIBILITY,
USM,
LLMOBS,
DATA_STREAMS,
CONTEXT_TRACKING,
RASP,
}
Expand Down Expand Up @@ -320,6 +322,24 @@ public final boolean isApplicable(Set<TargetSystem> enabledSystems) {
}
}

/** Parent class for instrumentations that support both tracing and Data Streams Monitoring */
public abstract static class DataStreams extends InstrumenterModule {
public DataStreams(String instrumentationName, String... additionalNames) {
super(instrumentationName, additionalNames);
}

@Override
public final boolean isApplicable(Set<TargetSystem> enabledSystems) {
return enabledSystems.contains(TargetSystem.TRACING)
|| enabledSystems.contains(TargetSystem.DATA_STREAMS);
}

@Override
public boolean isEnabled() {
return super.isEnabled() || InstrumenterConfig.get().isDataStreamsEnabled();
}
}

/** Parent class for all CI related instrumentations */
public abstract static class CiVisibility extends InstrumenterModule {
public CiVisibility(String instrumentationName, String... additionalNames) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package datadog.trace.agent.tooling;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import datadog.trace.agent.tooling.InstrumenterModule.TargetSystem;
import datadog.trace.test.junit.utils.config.WithConfig;
import datadog.trace.test.junit.utils.config.WithConfigExtension;
import java.util.HashSet;
import java.util.Set;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

@ExtendWith(WithConfigExtension.class)
class InstrumenterModuleTest {

@Test
void testDataStreamsIsApplicableWithTracing() {
Set<TargetSystem> enabledSystems = new HashSet<>();
enabledSystems.add(TargetSystem.TRACING);

InstrumenterModule.DataStreams module = new InstrumenterModule.DataStreams("test-module") {};

assertTrue(module.isApplicable(enabledSystems));
}

@Test
void testDataStreamsIsApplicableWithDataStreams() {
Set<TargetSystem> enabledSystems = new HashSet<>();
enabledSystems.add(TargetSystem.DATA_STREAMS);

InstrumenterModule.DataStreams module = new InstrumenterModule.DataStreams("test-module") {};

assertTrue(module.isApplicable(enabledSystems));
}

@Test
void testDataStreamsIsApplicableWithBoth() {
Set<TargetSystem> enabledSystems = new HashSet<>();
enabledSystems.add(TargetSystem.TRACING);
enabledSystems.add(TargetSystem.DATA_STREAMS);

InstrumenterModule.DataStreams module = new InstrumenterModule.DataStreams("test-module") {};

assertTrue(module.isApplicable(enabledSystems));
}

@Test
void testDataStreamsIsApplicableWithNeither() {
Set<TargetSystem> enabledSystems = new HashSet<>();
enabledSystems.add(TargetSystem.APPSEC);

InstrumenterModule.DataStreams module = new InstrumenterModule.DataStreams("test-module") {};

assertFalse(module.isApplicable(enabledSystems));
}

@Test
@WithConfig(key = "trace.test-kafka-module.enabled", value = "false")
@WithConfig(key = "data.streams.enabled", value = "true")
void testDataStreamsIsEnabledWhenDataStreamsEnabledOverridesFalse() {
// When tracing for this integration is disabled but DSM is explicitly enabled,
// isEnabled() should still return true.
InstrumenterModule.DataStreams module =
new InstrumenterModule.DataStreams("test-kafka-module") {};

assertTrue(module.isEnabled());
}

@Test
@WithConfig(key = "trace.test-kafka-module.enabled", value = "true")
@WithConfig(key = "data.streams.enabled", value = "false")
void testDataStreamsIsEnabledWhenSuperEnabledIsTrue() {
// When super.isEnabled() is true, isEnabled() should return true regardless of DSM state.
InstrumenterModule.DataStreams module =
new InstrumenterModule.DataStreams("test-kafka-module") {};

assertTrue(module.isEnabled());
}

@Test
@WithConfig(key = "trace.test-kafka-module.enabled", value = "true")
@WithConfig(key = "data.streams.enabled", value = "true")
void testDataStreamsIsEnabledWhenBothEnabled() {
// When both super.isEnabled() and DSM are enabled, isEnabled() should return true.
InstrumenterModule.DataStreams module =
new InstrumenterModule.DataStreams("test-kafka-module") {};

assertTrue(module.isEnabled());
}

@Test
@WithConfig(key = "trace.test-kafka-module.enabled", value = "false")
@WithConfig(key = "data.streams.enabled", value = "false")
void testDataStreamsIsEnabledWhenBothDisabled() {
// When both super.isEnabled() and DSM are disabled, isEnabled() should return false.
InstrumenterModule.DataStreams module =
new InstrumenterModule.DataStreams("test-kafka-module") {};

assertFalse(module.isEnabled());
}
}
2 changes: 1 addition & 1 deletion dd-java-agent/ddprof-lib/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath
ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath
com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.datadoghq:ddprof:1.48.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.datadoghq:ddprof:1.49.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.github.javaparser:javaparser-core:3.25.6=codenarc
com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs
com.github.spotbugs:spotbugs:4.9.8=spotbugs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
import org.apache.kafka.common.TopicPartition;

@AutoService(InstrumenterModule.class)
public final class ConsumerCoordinatorInstrumentation extends InstrumenterModule.Tracing
public final class ConsumerCoordinatorInstrumentation extends InstrumenterModule.DataStreams
implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice {

public ConsumerCoordinatorInstrumentation() {
super("kafka", "kafka-0.11");
super(KafkaDecorator.INTEGRATION_NAME, KafkaDecorator.LEGACY_INTEGRATION_NAME);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
* and cluster ID, in the context store for later use.
*/
@AutoService(InstrumenterModule.class)
public final class KafkaConsumerInfoInstrumentation extends InstrumenterModule.Tracing
public final class KafkaConsumerInfoInstrumentation extends InstrumenterModule.DataStreams
implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice {

public KafkaConsumerInfoInstrumentation() {
super("kafka", "kafka-0.11");
super(KafkaDecorator.INTEGRATION_NAME, KafkaDecorator.LEGACY_INTEGRATION_NAME);
}

@Override
Expand Down Expand Up @@ -252,7 +252,10 @@ public static AgentScope onEnter(@Advice.This KafkaConsumer consumer) {
}
}

if (traceConfig().isDataStreamsEnabled()) {
if (traceConfig().isDataStreamsEnabled() && KafkaDecorator.TRACING_ENABLED) {
// DSM-only mode (tracing disabled) never creates a real poll span: TracingIterator
// carries its pathway context on a lightweight, never-collected span shim instead, so
// there's nothing here that needs wrapping/protecting from being force-dropped.
final AgentSpan span = startSpan(JAVA_KAFKA.toString(), KAFKA_POLL);
return activateSpan(span);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
import org.apache.kafka.clients.consumer.ConsumerRecords;

@AutoService(InstrumenterModule.class)
public final class KafkaConsumerInstrumentation extends InstrumenterModule.Tracing
public final class KafkaConsumerInstrumentation extends InstrumenterModule.DataStreams
implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice {

public KafkaConsumerInstrumentation() {
super("kafka", "kafka-0.11");
super(KafkaDecorator.INTEGRATION_NAME, KafkaDecorator.LEGACY_INTEGRATION_NAME);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import datadog.trace.api.Config;
import datadog.trace.api.Functions;
import datadog.trace.api.InstrumenterConfig;
import datadog.trace.api.cache.DDCache;
import datadog.trace.api.cache.DDCaches;
import datadog.trace.api.naming.SpanNaming;
Expand All @@ -20,6 +21,7 @@
import datadog.trace.bootstrap.instrumentation.api.Tags;
import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString;
import datadog.trace.bootstrap.instrumentation.decorator.MessagingClientDecorator;
import java.util.Arrays;
import java.util.function.Function;
import java.util.function.Supplier;
import org.apache.kafka.clients.consumer.ConsumerRecord;
Expand All @@ -29,6 +31,10 @@

public class KafkaDecorator extends MessagingClientDecorator {
private static final String KAFKA = "kafka";
// Kept in sync with the names each kafka-clients-0.11 instrumentation module passes to its own
// super(...) constructor call, so TRACING_ENABLED can't drift from what is actually registered.
public static final String INTEGRATION_NAME = KAFKA;
public static final String LEGACY_INTEGRATION_NAME = "kafka-0.11";
public static final CharSequence JAVA_KAFKA = UTF8BytesString.create("java-kafka");
public static final CharSequence KAFKA_CONSUME =
UTF8BytesString.create(
Expand All @@ -42,6 +48,11 @@ public class KafkaDecorator extends MessagingClientDecorator {
public static final boolean KAFKA_LEGACY_TRACING = Config.get().isKafkaLegacyTracingEnabled();
public static final boolean TIME_IN_QUEUE_ENABLED =
Config.get().isTimeInQueueEnabled(!KAFKA_LEGACY_TRACING, KAFKA);
public static final boolean TRACING_ENABLED =
InstrumenterConfig.get()
.isIntegrationEnabled(
Arrays.asList(INTEGRATION_NAME, LEGACY_INTEGRATION_NAME),
InstrumenterConfig.get().isIntegrationsEnabled());
public static final String KAFKA_PRODUCED_KEY = "x_datadog_kafka_produced";
private final String spanKind;
private final CharSequence spanType;
Expand Down
Loading