Skip to content

Commit d343b8e

Browse files
Fix Dynatrace Token-Name property (#341)
During the migration to the new configuration properties, there was an oversight with the new Dynatrace token name property `sap.dynatrace.cf.binding.token.name` which was not considered. This change fixes the issue, so that the new and the deprecated property will be considered. Signed-off-by: Karsten Schnitter <k.schnitter@sap.com>
1 parent ab42338 commit d343b8e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import com.sap.hcf.cf.logging.opentelemetry.agent.ext.binding.CloudFoundryCredentials;
44
import com.sap.hcf.cf.logging.opentelemetry.agent.ext.binding.CloudFoundryServiceInstance;
55
import com.sap.hcf.cf.logging.opentelemetry.agent.ext.binding.DynatraceServiceProvider;
6-
import com.sap.hcf.cf.logging.opentelemetry.agent.ext.config.ExtensionConfigurations.DEPRECATED;
76
import com.sap.hcf.cf.logging.opentelemetry.agent.ext.config.ExtensionConfigurations.EXPORTER;
7+
import com.sap.hcf.cf.logging.opentelemetry.agent.ext.config.ExtensionConfigurations.RUNTIME;
88
import io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporter;
99
import io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder;
1010
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
@@ -121,10 +121,10 @@ public MetricExporter createExporter(ConfigProperties config) {
121121
"Credential \"" + CRED_DYNATRACE_APIURL + "\" not found. Skipping dynatrace exporter configuration");
122122
return NoopMetricExporter.getInstance();
123123
}
124-
String tokenName = DEPRECATED.RUNTIME.CLOUD_FOUNDRY.SERVICE.DYNATRACE.TOKEN_NAME_OTEL.getValue(config);
124+
String tokenName = RUNTIME.CLOUD_FOUNDRY.SERVICE.DYNATRACE.TOKEN_NAME.getValue(config);
125125
if (isBlank(tokenName)) {
126126
LOG.warning(
127-
"Configuration \"" + DEPRECATED.RUNTIME.CLOUD_FOUNDRY.SERVICE.DYNATRACE.TOKEN_NAME_OTEL.getKey() + "\" not found. Skipping dynatrace exporter configuration");
127+
"Configuration \"" + RUNTIME.CLOUD_FOUNDRY.SERVICE.DYNATRACE.TOKEN_NAME.getKey() + "\" not found. Skipping dynatrace exporter configuration");
128128
return NoopMetricExporter.getInstance();
129129
}
130130
String apiToken = credentials.getString(tokenName);

0 commit comments

Comments
 (0)