Skip to content

Commit

Permalink
Reenable kafka 3.8 by default (#8007)
Browse files Browse the repository at this point in the history
And add aliases to disambiguate the old and new Kafka instrumentations

---------

Co-authored-by: Stuart McCulloch <[email protected]>
  • Loading branch information
nayeem-kamal and mcculls authored Nov 25, 2024
1 parent 565afcd commit f2d21ae
Show file tree
Hide file tree
Showing 16 changed files with 12 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public final class ConsumerCoordinatorInstrumentation extends InstrumenterModule
implements Instrumenter.ForSingleType {

public ConsumerCoordinatorInstrumentation() {
super("kafka");
super("kafka", "kafka-0.11");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class KafkaConsumerInfoInstrumentation extends InstrumenterModule.T
implements Instrumenter.ForSingleType {

public KafkaConsumerInfoInstrumentation() {
super("kafka");
super("kafka", "kafka-0.11");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class KafkaConsumerInstrumentation extends InstrumenterModule.Traci
implements Instrumenter.ForSingleType {

public KafkaConsumerInstrumentation() {
super("kafka");
super("kafka", "kafka-0.11");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public final class KafkaProducerInstrumentation extends InstrumenterModule.Traci
implements Instrumenter.ForSingleType {

public KafkaProducerInstrumentation() {
super("kafka");
super("kafka", "kafka-0.11");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class MetadataInstrumentation extends InstrumenterModule.Tracing
implements Instrumenter.ForTypeHierarchy {

public MetadataInstrumentation() {
super("kafka");
super("kafka", "kafka-0.11");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.agent.tooling.InstrumenterModule;
import datadog.trace.api.Config;
import java.util.HashMap;
import java.util.Map;
import net.bytebuddy.matcher.ElementMatcher;
Expand All @@ -17,12 +16,7 @@ public final class ConsumerCoordinatorInstrumentation extends InstrumenterModule
implements Instrumenter.ForSingleType {

public ConsumerCoordinatorInstrumentation() {
super("kafka");
}

@Override
public boolean isEnabled() {
return super.isEnabled() && Config.get().isExperimentalKafkaEnabled();
super("kafka", "kafka-3.8");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.agent.tooling.InstrumenterModule;
import datadog.trace.api.Config;
import java.util.HashMap;
import java.util.Map;
import net.bytebuddy.description.type.TypeDescription;
Expand All @@ -29,12 +28,7 @@ public final class KafkaConsumerInfoInstrumentation extends InstrumenterModule.T
implements Instrumenter.ForTypeHierarchy {

public KafkaConsumerInfoInstrumentation() {
super("kafka");
}

@Override
public boolean isEnabled() {
return super.isEnabled() && Config.get().isExperimentalKafkaEnabled();
super("kafka", "kafka-3.8");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.agent.tooling.InstrumenterModule;
import datadog.trace.api.Config;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
Expand All @@ -24,12 +23,7 @@ public final class KafkaConsumerInstrumentation extends InstrumenterModule.Traci
implements Instrumenter.ForSingleType {

public KafkaConsumerInstrumentation() {
super("kafka");
}

@Override
public boolean isEnabled() {
return super.isEnabled() && Config.get().isExperimentalKafkaEnabled();
super("kafka", "kafka-3.8");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.agent.tooling.InstrumenterModule;
import datadog.trace.api.Config;
import java.util.Map;
import net.bytebuddy.matcher.ElementMatcher;

Expand All @@ -20,12 +19,7 @@ public final class KafkaProducerInstrumentation extends InstrumenterModule.Traci
implements Instrumenter.ForSingleType {

public KafkaProducerInstrumentation() {
super("kafka");
}

@Override
public boolean isEnabled() {
return super.isEnabled() && Config.get().isExperimentalKafkaEnabled();
super("kafka", "kafka-3.8");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.agent.tooling.InstrumenterModule;
import datadog.trace.api.Config;
import java.util.HashMap;
import java.util.Map;
import net.bytebuddy.description.type.TypeDescription;
Expand All @@ -29,12 +28,7 @@ public final class LegacyKafkaConsumerInfoInstrumentation extends InstrumenterMo
implements Instrumenter.ForTypeHierarchy {

public LegacyKafkaConsumerInfoInstrumentation() {
super("kafka");
}

@Override
public boolean isEnabled() {
return super.isEnabled() && Config.get().isExperimentalKafkaEnabled();
super("kafka", "kafka-3.8");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.agent.tooling.InstrumenterModule;
import datadog.trace.api.Config;
import java.util.Map;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;
Expand All @@ -20,12 +19,7 @@ public class MetadataInstrumentation extends InstrumenterModule.Tracing
implements Instrumenter.ForTypeHierarchy {

public MetadataInstrumentation() {
super("kafka");
}

@Override
public boolean isEnabled() {
return super.isEnabled() && Config.get().isExperimentalKafkaEnabled();
super("kafka", "kafka-3.8");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,14 @@

import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.agent.tooling.InstrumenterModule;
import datadog.trace.api.Config;
import net.bytebuddy.matcher.ElementMatcher;

// new - this instrumentation is completely new.
// the purpose of this class is to provide us with information on consumer group and cluster ID
public class OffsetCommitCallbackInvokerInstrumentation extends InstrumenterModule.Tracing
implements Instrumenter.ForSingleType {
public OffsetCommitCallbackInvokerInstrumentation() {
super("kafka");
}

@Override
public boolean isEnabled() {
return super.isEnabled() && Config.get().isExperimentalKafkaEnabled();
super("kafka", "kafka-3.8");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class KafkaClientCustomPropagationConfigTest extends AgentTestRunner {
super.configurePreAgent()

injectSysConfig("dd.kafka.e2e.duration.enabled", "true")
injectSysConfig("dd.trace.experimental.kafka.enabled","true")
}

@Flaky
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase {
super.configurePreAgent()

injectSysConfig("dd.kafka.e2e.duration.enabled", "true")
injectSysConfig("dd.trace.experimental.kafka.enabled","true")
}

public static final LinkedHashMap<String, String> PRODUCER_PATHWAY_EDGE_TAGS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,5 @@ public final class TraceInstrumentationConfig {
/** If set, the instrumentation will set its resource name on the local root too. */
public static final String AXIS_PROMOTE_RESOURCE_NAME = "trace.axis.promote.resource-name";

public static final String EXPERIMENTAL_KAFKA_ENABLED = "trace.experimental.kafka.enabled";

private TraceInstrumentationConfig() {}
}
7 changes: 0 additions & 7 deletions internal-api/src/main/java/datadog/trace/api/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,6 @@ public static String getHostName() {
private final boolean kafkaClientPropagationEnabled;
private final Set<String> kafkaClientPropagationDisabledTopics;
private final boolean kafkaClientBase64DecodingEnabled;
// enable the Kafka-3.8 instrumentation manually until testing issues are resolved.
private final boolean experimentalKafkaEnabled;

private final boolean jmsPropagationEnabled;
private final Set<String> jmsPropagationDisabledTopics;
Expand Down Expand Up @@ -1569,7 +1567,6 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment())
tryMakeImmutableSet(configProvider.getList(KAFKA_CLIENT_PROPAGATION_DISABLED_TOPICS));
kafkaClientBase64DecodingEnabled =
configProvider.getBoolean(KAFKA_CLIENT_BASE64_DECODING_ENABLED, false);
experimentalKafkaEnabled = configProvider.getBoolean(EXPERIMENTAL_KAFKA_ENABLED, false);
jmsPropagationEnabled = isPropagationEnabled(true, "jms");
jmsPropagationDisabledTopics =
tryMakeImmutableSet(configProvider.getList(JMS_PROPAGATION_DISABLED_TOPICS));
Expand Down Expand Up @@ -3055,10 +3052,6 @@ public boolean isKafkaClientBase64DecodingEnabled() {
return kafkaClientBase64DecodingEnabled;
}

public boolean isExperimentalKafkaEnabled() {
return experimentalKafkaEnabled;
}

public boolean isRabbitPropagationEnabled() {
return rabbitPropagationEnabled;
}
Expand Down

0 comments on commit f2d21ae

Please sign in to comment.