diff --git a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/ResourceProviderPropertiesCustomizer.java b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/ResourceProviderPropertiesCustomizer.java index 3e3719663db2..c2a01156f1c2 100644 --- a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/ResourceProviderPropertiesCustomizer.java +++ b/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/ResourceProviderPropertiesCustomizer.java @@ -35,7 +35,7 @@ public class ResourceProviderPropertiesCustomizer implements AutoConfigurationCu DISABLED_BY_DEFAULT_RESOURCE_PROVIDERS.put( "io.opentelemetry.contrib.aws.resource.LambdaResourceProvider", "aws"); DISABLED_BY_DEFAULT_RESOURCE_PROVIDERS.put( - "io.opentelemetry.contrib.gcp.resource.GCPResourceProvider", "aws"); + "io.opentelemetry.contrib.gcp.resource.GCPResourceProvider", "gcp"); // for testing DISABLED_BY_DEFAULT_RESOURCE_PROVIDERS.put( "io.opentelemetry.javaagent.tooling.config.ResourceProviderPropertiesCustomizerTest$Provider", @@ -62,7 +62,8 @@ Map customize(ConfigProperties config) { String providerName = providerEntry.getKey(); String providerGroup = providerEntry.getValue(); Boolean explictEnabled = - config.getBoolean(String.format("otel.instrumentation.%s.enabled", providerGroup)); + config.getBoolean( + String.format("otel.instrumentation.resource-provider.%s.enabled", providerGroup)); if (isEnabled(providerName, enabledProviders, explictEnabled)) { enabled.add(providerName); diff --git a/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/tooling/config/ResourceProviderPropertiesCustomizerTest.java b/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/tooling/config/ResourceProviderPropertiesCustomizerTest.java index cde06658ce9e..b82fa8ea4e85 100644 --- a/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/tooling/config/ResourceProviderPropertiesCustomizerTest.java +++ b/javaagent-tooling/src/test/java/io/opentelemetry/javaagent/tooling/config/ResourceProviderPropertiesCustomizerTest.java @@ -12,6 +12,7 @@ import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk; import io.opentelemetry.sdk.autoconfigure.SdkAutoconfigureAccess; import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; +import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider; import io.opentelemetry.sdk.resources.Resource; import java.util.Collections; import java.util.HashMap; @@ -25,8 +26,7 @@ public class ResourceProviderPropertiesCustomizerTest { - public static final class Provider - implements io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider { + public static final class Provider implements ResourceProvider { @Override public Resource createResource(ConfigProperties config) { return Resource.create(Attributes.of(AttributeKey.stringKey("key"), "value")); @@ -115,7 +115,7 @@ Stream enabledTestCases() { if (tc.explicitEnabled != null) { props.put( - "otel.instrumentation.test.enabled", + "otel.instrumentation.resource-provider.test.enabled", Boolean.toString(tc.explicitEnabled)); }