Skip to content

Commit 7288ef3

Browse files
committed
set default exporter to otlp
1 parent 20c5cc9 commit 7288ef3

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

jmx-scraper/src/main/java/io/opentelemetry/contrib/jmxscraper/config/PropertiesCustomizer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ public class PropertiesCustomizer implements Function<ConfigProperties, Map<Stri
2828
public Map<String, String> apply(ConfigProperties config) {
2929
Map<String, String> result = new HashMap<>();
3030

31-
// set default exporter to logging when not explicitly set
31+
// set default exporter to 'otlp' to be consistent with SDK
3232
if (config.getList(METRICS_EXPORTER).isEmpty()) {
33-
logger.info(METRICS_EXPORTER + " is not set, default of 'logging' will be used");
34-
result.put(METRICS_EXPORTER, "logging");
33+
result.put(METRICS_EXPORTER, "otlp");
3534
}
3635

3736
// providing compatibility with the existing 'otel.jmx.interval.milliseconds' config option

jmx-scraper/src/test/java/io/opentelemetry/contrib/jmxscraper/config/PropertiesCustomizerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ void tryGetConfigBeforeApply() {
2424
}
2525

2626
@Test
27-
void defaultLoggingExporter() {
27+
void defaultOtlpExporter() {
2828
Map<String, String> map = new HashMap<>();
2929
map.put("otel.jmx.service.url", "dummy-url");
3030
map.put("otel.jmx.target.system", "jvm");
3131
ConfigProperties config = DefaultConfigProperties.createFromMap(map);
3232

3333
PropertiesCustomizer customizer = new PropertiesCustomizer();
34-
assertThat(customizer.apply(config)).containsEntry("otel.metrics.exporter", "logging");
34+
assertThat(customizer.apply(config)).containsEntry("otel.metrics.exporter", "otlp");
3535
}
3636

3737
@Test

0 commit comments

Comments
 (0)