Skip to content

Commit e605f0e

Browse files
Fix Configuration parsing
#221 upgraded the OpenTelemetry SDK version. This changed the construction of the `DefaultConfigProperties` in an incompatible way. This lead to ignored configuration properties. This change ensures, that the original behavior is restored. The now used method reads the environment variables and system properties again. Signed-off-by: Karsten Schnitter <[email protected]>
1 parent 0532230 commit e605f0e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cf-java-logging-support-opentelemetry-agent-extension/src/main/java/com/sap/hcf/cf/logging/opentelemetry/agent/ext/binding/CloudLoggingBindingPropertiesSupplier.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.sap.hcf.cf.logging.opentelemetry.agent.ext.binding;
22

3+
import io.opentelemetry.common.ComponentLoader;
34
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
45
import io.opentelemetry.sdk.autoconfigure.spi.internal.DefaultConfigProperties;
56

@@ -36,7 +37,9 @@ private static ConfigProperties getDefaultProperties() {
3637
defaults.put("com.sap.otel.extension.cloud-logging.label", "cloud-logging");
3738
defaults.put("com.sap.otel.extension.cloud-logging.tag", "Cloud Logging");
3839
defaults.put("otel.javaagent.extension.sap.cf.binding.user-provided.label", "user-provided");
39-
return DefaultConfigProperties.createFromMap(defaults);
40+
ComponentLoader componentLoader =
41+
ComponentLoader.forClassLoader(DefaultConfigProperties.class.getClassLoader());
42+
return DefaultConfigProperties.create(defaults, componentLoader);
4043
}
4144

4245
private static boolean isBlank(String text) {

0 commit comments

Comments
 (0)