Skip to content

Commit cb5eb56

Browse files
committed
use snake case props
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent 58ac08c commit cb5eb56

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterPropertiesTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,17 @@ void prometheusTimestampsInMs() {
7474
assertThat(properties.getPrometheusTimestampsInMs()).isTrue();
7575

7676
properties =
77-
load(new HashMap<>(Map.of("io.prometheus.exporter.prometheusTimestampsInMs", "true")));
77+
load(new HashMap<>(Map.of("io.prometheus.exporter.prometheus_timestamps_in_ms", "true")));
7878
assertThat(properties.getPrometheusTimestampsInMs()).isTrue();
7979

8080
assertThatExceptionOfType(PrometheusPropertiesException.class)
8181
.isThrownBy(
8282
() ->
8383
load(
8484
new HashMap<>(
85-
Map.of("io.prometheus.exporter.prometheusTimestampsInMs", "invalid"))))
85+
Map.of("io.prometheus.exporter.prometheus_timestamps_in_ms", "invalid"))))
8686
.withMessage(
87-
"io.prometheus.exporter.prometheusTimestampsInMs: Expecting 'true' or 'false'. Found:"
87+
"io.prometheus.exporter.prometheus_timestamps_in_ms: Expecting 'true' or 'false'. Found:"
8888
+ " invalid");
8989
}
9090
}

prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterPushgatewayPropertiesTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,26 @@ void loadWithHttps() {
4040
@Test
4141
void loadWithEscapingSchemes() {
4242
ExporterPushgatewayProperties properties =
43-
load(Map.of("io.prometheus.exporter.pushgateway.escapingScheme", "allow-utf-8"));
43+
load(Map.of("io.prometheus.exporter.pushgateway.escaping_scheme", "allow-utf-8"));
4444
assertThat(properties.getEscapingScheme()).isEqualTo(EscapingScheme.ALLOW_UTF8);
4545

46-
properties = load(Map.of("io.prometheus.exporter.pushgateway.escapingScheme", "values"));
46+
properties = load(Map.of("io.prometheus.exporter.pushgateway.escaping_scheme", "values"));
4747
assertThat(properties.getEscapingScheme()).isEqualTo(EscapingScheme.VALUE_ENCODING_ESCAPING);
4848

49-
properties = load(Map.of("io.prometheus.exporter.pushgateway.escapingScheme", "underscores"));
49+
properties = load(Map.of("io.prometheus.exporter.pushgateway.escaping_scheme", "underscores"));
5050
assertThat(properties.getEscapingScheme()).isEqualTo(EscapingScheme.UNDERSCORE_ESCAPING);
5151

52-
properties = load(Map.of("io.prometheus.exporter.pushgateway.escapingScheme", "dots"));
52+
properties = load(Map.of("io.prometheus.exporter.pushgateway.escaping_scheme", "dots"));
5353
assertThat(properties.getEscapingScheme()).isEqualTo(EscapingScheme.DOTS_ESCAPING);
5454
}
5555

5656
@Test
5757
void loadWithInvalidEscapingScheme() {
5858
assertThatExceptionOfType(PrometheusPropertiesException.class)
5959
.isThrownBy(
60-
() -> load(Map.of("io.prometheus.exporter.pushgateway.escapingScheme", "invalid")))
60+
() -> load(Map.of("io.prometheus.exporter.pushgateway.escaping_scheme", "invalid")))
6161
.withMessage(
62-
"io.prometheus.exporter.pushgateway.escapingScheme: Illegal value. Expecting"
62+
"io.prometheus.exporter.pushgateway.escaping_scheme: Illegal value. Expecting"
6363
+ " 'allow-utf-8', 'values', 'underscores', or 'dots'. Found: invalid");
6464
}
6565

@@ -68,8 +68,8 @@ void loadWithTimeouts() {
6868
ExporterPushgatewayProperties properties =
6969
load(
7070
Map.of(
71-
"io.prometheus.exporter.pushgateway.connectTimeoutSeconds", "5",
72-
"io.prometheus.exporter.pushgateway.readTimeoutSeconds", "10"));
71+
"io.prometheus.exporter.pushgateway.connect_timeout_seconds", "5",
72+
"io.prometheus.exporter.pushgateway.read_timeout_seconds", "10"));
7373
assertThat(properties.getConnectTimeout()).isEqualTo(Duration.ofSeconds(5));
7474
assertThat(properties.getReadTimeout()).isEqualTo(Duration.ofSeconds(10));
7575
}

0 commit comments

Comments
 (0)