Replace '-' with '_' in configuration parameter names
This commit is contained in:
parent
601993fcb4
commit
950ab63f64
|
@ -197,7 +197,7 @@ public class Config {
|
|||
}
|
||||
|
||||
private static String propertyToEnvironmentName(final String name) {
|
||||
return name.toUpperCase().replace(".", "_");
|
||||
return name.toUpperCase().replace(".", "_").replace("-", "_");
|
||||
}
|
||||
|
||||
private static Map<String, String> getPropertyMapValue(
|
||||
|
|
|
@ -18,6 +18,7 @@ class ConfigTest extends Specification {
|
|||
private static final DD_SERVICE_MAPPING_ENV = "DD_SERVICE_MAPPING"
|
||||
private static final DD_SPAN_TAGS_ENV = "DD_SPAN_TAGS"
|
||||
private static final DD_HEADER_TAGS_ENV = "DD_HEADER_TAGS"
|
||||
private static final DD_JMXFETCH_METRICS_CONFIGS_ENV = "DD_JMXFETCH_METRICS_CONFIGS"
|
||||
|
||||
def "verify defaults"() {
|
||||
when:
|
||||
|
@ -89,6 +90,7 @@ class ConfigTest extends Specification {
|
|||
setup:
|
||||
environmentVariables.set(DD_SERVICE_NAME_ENV, "still something else")
|
||||
environmentVariables.set(DD_WRITER_TYPE_ENV, "LoggingWriter")
|
||||
environmentVariables.set(DD_JMXFETCH_METRICS_CONFIGS_ENV, "some/file")
|
||||
|
||||
when:
|
||||
def config = new Config()
|
||||
|
@ -96,6 +98,7 @@ class ConfigTest extends Specification {
|
|||
then:
|
||||
config.serviceName == "still something else"
|
||||
config.writerType == "LoggingWriter"
|
||||
config.jmxFetchMetricsConfigs == ["some/file"]
|
||||
}
|
||||
|
||||
def "sys props override env vars"() {
|
||||
|
|
Loading…
Reference in New Issue