Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
2d7afa6
indy an early init setting that can't wait for declarative config bridge
zeitlinger Jan 12, 2026
e7cfa40
add InstrumentationMode enum
zeitlinger Jan 6, 2026
e6762ae
add InstrumentationMode enum
zeitlinger Jan 6, 2026
93ce157
add module_configuration
zeitlinger Jan 9, 2026
f0a6ff0
add module_configuration
zeitlinger Jan 9, 2026
19fe3b4
spring
zeitlinger Jan 9, 2026
95eab6d
spring
zeitlinger Jan 9, 2026
18f5ac2
revert first try
zeitlinger Jan 9, 2026
e77ab15
distro node
zeitlinger Jan 9, 2026
704c3ff
distro node
zeitlinger Jan 9, 2026
536cf6d
distro node
zeitlinger Jan 9, 2026
81aa9f1
distro node
zeitlinger Jan 9, 2026
9784cc8
distro node
zeitlinger Jan 9, 2026
6da355c
distro node
zeitlinger Jan 9, 2026
4daa9c6
distro node
zeitlinger Jan 9, 2026
1000d69
add EnabledInstrumentations
zeitlinger Jan 10, 2026
4cc5fa2
add EnabledInstrumentations
zeitlinger Jan 10, 2026
46f17a2
add EnabledInstrumentations
zeitlinger Jan 10, 2026
d10cca0
add EnabledInstrumentations
zeitlinger Jan 10, 2026
b3ddef1
add EnabledInstrumentations
zeitlinger Jan 10, 2026
9fd212c
use distro node
zeitlinger Jan 10, 2026
2078266
use distro node
zeitlinger Jan 10, 2026
4a85ce0
use distro node
zeitlinger Jan 10, 2026
c7c618c
AgentDistributionConfig
zeitlinger Jan 10, 2026
acbbf00
AgentDistributionConfig
zeitlinger Jan 10, 2026
a018c52
AgentDistributionConfig
zeitlinger Jan 10, 2026
8e30042
fix
zeitlinger Jan 12, 2026
714ea16
fix
zeitlinger Jan 12, 2026
cff5807
fix
zeitlinger Jan 12, 2026
67a487a
fix
zeitlinger Jan 12, 2026
39a5c91
fix
zeitlinger Jan 12, 2026
f3d41c2
thread details should not move to distribution setting
zeitlinger Jan 12, 2026
034b4c9
fix thread details
zeitlinger Jan 12, 2026
ab278d6
split off AgentEnabledInstrumentations
zeitlinger Jan 12, 2026
e00bcad
otel.javaagent.experimental.force-synchronous-agent-listeners is an e…
zeitlinger Jan 12, 2026
928601b
Revert "otel.javaagent.experimental.force-synchronous-agent-listeners…
zeitlinger Jan 12, 2026
7429911
fix
zeitlinger Jan 12, 2026
2298ac1
rename modules to snake case
zeitlinger Jan 12, 2026
0c5a87e
rename modules to snake case
zeitlinger Jan 12, 2026
360cc39
rename modules to snake case
zeitlinger Jan 12, 2026
13896e0
rename modules to snake case
zeitlinger Jan 12, 2026
24fcab5
rename modules to snake case
zeitlinger Jan 12, 2026
5500149
fix
zeitlinger Jan 12, 2026
191f8d7
fix
zeitlinger Jan 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions .github/scripts/check-javaagent-suppression-keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ for file in $(find instrumentation -name "*Module.java"); do
continue
fi

module_name=$(echo "$file" | sed 's#.*/\([^/]*\)/javaagent/src/.*#\1#')
simple_module_name=$(echo "$module_name" | sed 's/-[0-9.]*$//')
module_name=$(echo "$file" | sed 's#.*/\([^/]*\)/javaagent/src/.*#\1#' | tr '-' '_')
simple_module_name=$(echo "$module_name" | sed 's/_[0-9.]*$//')

if [[ "$simple_module_name" == *jaxrs* ]]; then
# TODO these need some work still
Expand All @@ -25,17 +25,17 @@ for file in $(find instrumentation -name "*Module.java"); do
# TODO split jdbc-datasource out into separate instrumentation?
continue
fi
if [[ "$simple_module_name" == kafka-clients ]]; then
if [[ "$simple_module_name" == kafka_clients ]]; then
# TODO split kafka client metrics out into separate instrumentation?
continue
fi
if [[ "$simple_module_name" == quarkus-resteasy-reactive ]]; then
if [[ "$simple_module_name" == quarkus_resteasy_reactive ]]; then
# TODO module is missing a base version
continue
fi
if [[ "$simple_module_name" == spring-cloud-gateway-webmvc ]]; then
if [[ "$simple_module_name" == spring_cloud_gateway_webmvc ]]; then
# webmvc variant uses spring-cloud-gateway as base name
simple_module_name="spring-cloud-gateway"
simple_module_name="spring_cloud_gateway"
fi

if [ "$module_name" == "$simple_module_name" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ public final class ConfigPropertiesBackedDeclarativeConfigProperties

private static final String GENERAL_PEER_SERVICE_MAPPING = "general.peer.service_mapping";

private static final String AGENT_INSTRUMENTATION_MODE = "java.agent.instrumentation_mode";
private static final String SPRING_STARTER_INSTRUMENTATION_MODE =
"java.spring_starter.instrumentation_mode";
private static final String COMMON_DEFAULT_ENABLED =
"otel.instrumentation.common.default-enabled";

private static final Map<String, String> SPECIAL_MAPPINGS;

static {
Expand Down Expand Up @@ -115,17 +109,6 @@ private ConfigPropertiesBackedDeclarativeConfigProperties(
@Nullable
@Override
public String getString(String name) {
String fullPath = pathWithName(name);

if (fullPath.equals(AGENT_INSTRUMENTATION_MODE)
|| fullPath.equals(SPRING_STARTER_INSTRUMENTATION_MODE)) {
Boolean value = configProperties.getBoolean(COMMON_DEFAULT_ENABLED);
if (value != null) {
return value ? "default" : "none";
}
return null;
}

return configProperties.getString(resolvePropertyKey(name));
}

Expand Down Expand Up @@ -243,9 +226,10 @@ private String resolvePropertyKey(String name) {

String translated = translatedPath.toString();

// Handle agent prefix: java.agent.* → otel.javaagent.*
if (translated.startsWith("agent.")) {
return "otel.java" + translated;
// Handle agent prefix: java.javaagent.* → otel.javaagent.*
// is only called from OpenTelemetryInstaller
if (translated.startsWith("javaagent.")) {
return "otel." + translated;
}

// Standard mapping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ void testTranslateName_withExperimentalInMiddle() {

@Test
void testAgentPrefix() {
DeclarativeConfigProperties config = createConfig("otel.javaagent.experimental.indy", "true");
DeclarativeConfigProperties config = createConfig("otel.javaagent.experimental.foo", "true");

assertThat(config.getStructured("java").getStructured("agent").getBoolean("indy/development"))
// only called from OpenTelemetryInstaller
assertThat(
config.getStructured("java").getStructured("javaagent").getBoolean("foo/development"))
.isNotNull()
.isTrue();
}
Expand Down Expand Up @@ -238,61 +240,6 @@ void testWithoutJavaPrefix_doesNotMatch() {
.isNull();
}

@Test
void testAgentInstrumentationMode_getString_booleanTrue() {
DeclarativeConfigProperties config =
createConfig("otel.instrumentation.common.default-enabled", "true");

assertThat(
config.getStructured("java").getStructured("agent").getString("instrumentation_mode"))
.isEqualTo("default");
}

@Test
void testAgentInstrumentationMode_getString_booleanFalse() {
DeclarativeConfigProperties config =
createConfig("otel.instrumentation.common.default-enabled", "false");

assertThat(
config.getStructured("java").getStructured("agent").getString("instrumentation_mode"))
.isEqualTo("none");
}

@Test
void testSpringStarterInstrumentationMode_getString_booleanTrue() {
DeclarativeConfigProperties config =
createConfig("otel.instrumentation.common.default-enabled", "true");

assertThat(
config
.getStructured("java")
.getStructured("spring_starter")
.getString("instrumentation_mode"))
.isEqualTo("default");
}

@Test
void testSpringStarterInstrumentationMode_getString_booleanFalse() {
DeclarativeConfigProperties config =
createConfig("otel.instrumentation.common.default-enabled", "false");

assertThat(
config
.getStructured("java")
.getStructured("spring_starter")
.getString("instrumentation_mode"))
.isEqualTo("none");
}

@Test
void testAgentInstrumentationMode_notSet() {
DeclarativeConfigProperties config = createConfig("some.other.property", "value");

assertThat(
config.getStructured("java").getStructured("agent").getString("instrumentation_mode"))
.isNull();
}

private static DeclarativeConfigProperties createConfig(String key, String value) {
Map<String, String> properties = new HashMap<>();
properties.put(key, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,21 @@
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.extension.incubator.fileconfig.DeclarativeConfiguration;
import io.opentelemetry.sdk.extension.incubator.fileconfig.SdkConfigProvider;
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.InstrumentationModel;
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.OpenTelemetryConfigurationModel;
import java.time.Duration;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

class DeclarativeConfigPropertiesBridgeTest {

private ConfigProperties bridge;
private ConfigProperties emptyBridge;

@BeforeEach
void setup() {
bridge = create(new DeclarativeConfigPropertiesBridgeBuilder());

OpenTelemetryConfigurationModel emptyModel =
new OpenTelemetryConfigurationModel()
.withAdditionalProperty("instrumentation/development", new InstrumentationModel());
SdkConfigProvider emptyConfigProvider = SdkConfigProvider.create(emptyModel);
emptyBridge =
new DeclarativeConfigPropertiesBridgeBuilder()
.buildFromInstrumentationConfig(
Objects.requireNonNull(emptyConfigProvider.getInstrumentationConfig()));
}

private static ConfigProperties create(DeclarativeConfigPropertiesBridgeBuilder builder) {
Expand All @@ -55,9 +43,6 @@ void getProperties() {
// asking for properties which don't exist or inaccessible shouldn't result in an error
assertThat(bridge.getString("file_format")).isNull();
assertThat(bridge.getString("file_format", "foo")).isEqualTo("foo");
assertThat(emptyBridge.getBoolean("otel.instrumentation.common.default-enabled")).isNull();
assertThat(emptyBridge.getBoolean("otel.instrumentation.common.default-enabled", true))
.isTrue();

// common cases
assertThat(bridge.getBoolean("otel.instrumentation.runtime-telemetry.enabled")).isFalse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@AutoService(InstrumentationModule.class)
public final class DemoServlet3InstrumentationModule extends InstrumentationModule {
public DemoServlet3InstrumentationModule() {
super("servlet-demo", "servlet-3");
super("servlet_demo", "servlet_3");
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@AutoService(InstrumentationModule.class)
public final class DemoServlet3InstrumentationModule extends InstrumentationModule {
public DemoServlet3InstrumentationModule() {
super("servlet-demo", "servlet-3");
super("servlet_demo", "servlet_3");
}

/*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.instrumentation.api.incubator.config;

import javax.annotation.Nullable;

/** Provides information about which instrumentations are enabled. */
public interface EnabledInstrumentations {
/**
* Returns whether the given instrumentation is enabled.
*
* @param instrumentationName the name of the instrumentation
* @return {@code Boolean.TRUE} if the instrumentation is enabled, {@code Boolean.FALSE} if it is
* disabled, or {@code null} if the default setting should be used
*/
@Nullable
Boolean getEnabled(String instrumentationName);

/**
* Returns whether instrumentations are enabled by default.
*
* @return {@code true} if instrumentations are enabled by default, {@code false} otherwise
*/
boolean isDefaultEnabled();

/**
* Returns whether the given instrumentation is explicitly enabled (i.e., not relying on the
* default setting).
*
* @param instrumentationName the name of the instrumentation
* @return {@code true} if the instrumentation is explicitly enabled, {@code false} otherwise
*/
default boolean isEnabledExplicitly(String instrumentationName) {
return Boolean.TRUE.equals(getEnabled(instrumentationName));
}

/**
* Returns whether the given instrumentation is enabled, falling back to the default setting if
* not explicitly configured.
*
* @param instrumentationName the name of the instrumentation
* @return {@code true} if the instrumentation is enabled, {@code false} otherwise
*/
default boolean isEnabled(String instrumentationName) {
Boolean enabled = getEnabled(instrumentationName);
if (enabled != null) {
return enabled;
}
return isDefaultEnabled();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public final class ExtendedDeclarativeConfigProperties implements DeclarativeCon

private final DeclarativeConfigProperties delegate;

ExtendedDeclarativeConfigProperties(DeclarativeConfigProperties delegate) {
// will be deleted soon
public ExtendedDeclarativeConfigProperties(DeclarativeConfigProperties delegate) {
this.delegate = delegate;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ActivejHttpServerInstrumentationModule extends InstrumentationModul
implements ExperimentalInstrumentationModule {

public ActivejHttpServerInstrumentationModule() {
super("activej-http", "activej-http-6.0");
super("activej_http", "activej_http_6.0");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public class AkkaActorInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {
public AkkaActorInstrumentationModule() {
super("akka-actor", "akka-actor-2.3");
super("akka_actor", "akka_actor_2.3");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public class AkkaActorForkJoinInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {
public AkkaActorForkJoinInstrumentationModule() {
super("akka-actor-fork-join", "akka-actor-fork-join-2.5", "akka-actor");
super("akka_actor_fork_join", "akka_actor_fork_join_2.5", "akka_actor");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public class AkkaHttpClientInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {
public AkkaHttpClientInstrumentationModule() {
super("akka-http", "akka-http-10.0", "akka-http-client");
super("akka_http", "akka_http_10.0", "akka_http_client");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public class AkkaHttpServerInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {
public AkkaHttpServerInstrumentationModule() {
super("akka-http", "akka-http-10.0", "akka-http-server");
super("akka_http", "akka_http_10.0", "akka_http_server");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class AkkaHttpServerRouteInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {
public AkkaHttpServerRouteInstrumentationModule() {
super("akka-http", "akka-http-10.0", "akka-http-server", "akka-http-server-route");
super("akka_http", "akka_http_10.0", "akka_http_server", "akka_http_server_route");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class DruidInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {

public DruidInstrumentationModule() {
super("alibaba-druid", "alibaba-druid-1.0");
super("alibaba_druid", "alibaba_druid_1.0");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@AutoService(InstrumentationModule.class)
public class ApacheDbcpInstrumentationModule extends InstrumentationModule {
public ApacheDbcpInstrumentationModule() {
super("apache-dbcp", "apache-dbcp-2.0");
super("apache_dbcp", "apache_dbcp_2.0");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
public class DubboInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {
public DubboInstrumentationModule() {
super("apache-dubbo", "apache-dubbo-2.7");
super("apache_dubbo", "apache_dubbo_2.7");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ElasticJobInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {

public ElasticJobInstrumentationModule() {
super("apache-elasticjob", "apache-elasticjob-3.0");
super("apache_elasticjob", "apache_elasticjob_3.0");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public class ApacheHttpAsyncClientInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {
public ApacheHttpAsyncClientInstrumentationModule() {
super("apache-httpasyncclient", "apache-httpasyncclient-4.1");
super("apache_httpasyncclient", "apache_httpasyncclient_4.1");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ApacheHttpClientInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {

public ApacheHttpClientInstrumentationModule() {
super("apache-httpclient", "apache-httpclient-2.0");
super("apache_httpclient", "apache_httpclient_2.0");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ApacheHttpClientInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {

public ApacheHttpClientInstrumentationModule() {
super("apache-httpclient", "apache-httpclient-4.0");
super("apache_httpclient", "apache_httpclient_4.0");
}

@Override
Expand Down
Loading
Loading