Skip to content

Commit 256fcf5

Browse files
authored
Remove support for old EnvironmentResourceProvider package name. (#7622)
1 parent e474360 commit 256fcf5

File tree

2 files changed

+0
-53
lines changed

2 files changed

+0
-53
lines changed

sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/ResourceConfiguration.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
import java.util.Map;
2727
import java.util.Set;
2828
import java.util.function.BiFunction;
29-
import java.util.logging.Level;
30-
import java.util.logging.Logger;
3129

3230
/**
3331
* Auto-configuration for the OpenTelemetry {@link Resource}.
@@ -36,8 +34,6 @@
3634
*/
3735
public final class ResourceConfiguration {
3836

39-
private static final Logger logger = Logger.getLogger(ResourceConfiguration.class.getName());
40-
4137
private static final AttributeKey<String> SERVICE_NAME = AttributeKey.stringKey("service.name");
4238

4339
// Visible for testing
@@ -47,11 +43,6 @@ public final class ResourceConfiguration {
4743
static final String ENABLED_RESOURCE_PROVIDERS = "otel.java.enabled.resource.providers";
4844
static final String DISABLED_RESOURCE_PROVIDERS = "otel.java.disabled.resource.providers";
4945

50-
private static final String OLD_ENVIRONMENT_DETECTOR_FQCN =
51-
"io.opentelemetry.sdk.autoconfigure.internal.EnvironmentResourceProvider";
52-
private static final String NEW_ENVIRONMENT_DETECT_FQCN =
53-
EnvironmentResourceProvider.class.getName();
54-
5546
/**
5647
* Create a {@link Resource} from the environment. The resource contains attributes parsed from
5748
* environment variables and system property keys {@code otel.resource.attributes} and {@code
@@ -104,32 +95,7 @@ static Resource configureResource(
10495
Resource result = Resource.getDefault();
10596

10697
Set<String> enabledProviders = new HashSet<>(config.getList(ENABLED_RESOURCE_PROVIDERS));
107-
if (enabledProviders.remove(OLD_ENVIRONMENT_DETECTOR_FQCN)) {
108-
logger.log(
109-
Level.WARNING,
110-
"Found reference to "
111-
+ OLD_ENVIRONMENT_DETECTOR_FQCN
112-
+ " in "
113-
+ ENABLED_RESOURCE_PROVIDERS
114-
+ ". Please update to "
115-
+ NEW_ENVIRONMENT_DETECT_FQCN
116-
+ ". Support for the old provider name will be removed after 1.49.0.");
117-
enabledProviders.add(NEW_ENVIRONMENT_DETECT_FQCN);
118-
}
119-
12098
Set<String> disabledProviders = new HashSet<>(config.getList(DISABLED_RESOURCE_PROVIDERS));
121-
if (disabledProviders.remove(OLD_ENVIRONMENT_DETECTOR_FQCN)) {
122-
logger.log(
123-
Level.WARNING,
124-
"Found reference to "
125-
+ OLD_ENVIRONMENT_DETECTOR_FQCN
126-
+ " in "
127-
+ DISABLED_RESOURCE_PROVIDERS
128-
+ ". Please update to "
129-
+ NEW_ENVIRONMENT_DETECT_FQCN
130-
+ ". Support for the old provider name will be removed after 1.49.0.");
131-
disabledProviders.add(NEW_ENVIRONMENT_DETECT_FQCN);
132-
}
13399

134100
for (ResourceProvider resourceProvider : spiHelper.loadOrdered(ResourceProvider.class)) {
135101
if (!enabledProviders.isEmpty()

sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/ResourceConfigurationTest.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -134,25 +134,6 @@ private static Stream<Arguments> configureResourceArgs() {
134134
Arguments.of(
135135
null,
136136
"io.opentelemetry.sdk.autoconfigure.EnvironmentResourceProvider",
137-
attributeConsumer(
138-
attr ->
139-
attr.containsEntry("service.name", "unknown_service:java")
140-
.doesNotContainKey("cat")
141-
.containsEntry("animal", "cat")
142-
.containsEntry("color", "blue"))),
143-
// old environment resource provider FQCN
144-
Arguments.of(
145-
"io.opentelemetry.sdk.autoconfigure.internal.EnvironmentResourceProvider",
146-
null,
147-
attributeConsumer(
148-
attr ->
149-
attr.containsEntry("service.name", "test")
150-
.containsEntry("cat", "meow")
151-
.doesNotContainKey("animal")
152-
.doesNotContainKey("color"))),
153-
Arguments.of(
154-
null,
155-
"io.opentelemetry.sdk.autoconfigure.internal.EnvironmentResourceProvider",
156137
attributeConsumer(
157138
attr ->
158139
attr.containsEntry("service.name", "unknown_service:java")

0 commit comments

Comments
 (0)