Skip to content

Commit d2f1b6b

Browse files
committed
normalize system props before lookup to avoid ambiguity of "experimental-foo" and "experimental.foo" that both translate to "foo/development"
1 parent d7d0ba8 commit d2f1b6b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/ConfigPropertiesUtil.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ public final class ConfigPropertiesUtil {
3535

3636
public static Map<String, String> load() {
3737
Map<String, String> config = new HashMap<>();
38-
System.getenv()
39-
.forEach((name, value) -> config.put(normalizeEnvironmentVariableKey(name), value));
40-
safeSystemProperties()
41-
.forEach(
42-
(key, value) -> config.put(normalizePropertyKey(key.toString()), value.toString()));
38+
for (Map.Entry<String, String> entry : System.getenv().entrySet()) {
39+
config.put(normalizeEnvironmentVariableKey(entry.getKey()), entry.getValue());
40+
}
41+
for (Map.Entry<Object, Object> entry : safeSystemProperties().entrySet()) {
42+
config.put(normalizePropertyKey(entry.getKey().toString()), entry.getValue().toString());
43+
}
4344
return config;
4445
}
4546

0 commit comments

Comments
 (0)