Skip to content

Commit

Permalink
including prometheus conditionally doesn't seem to work - and it not …
Browse files Browse the repository at this point in the history
…gaining that much
  • Loading branch information
zeitlinger committed Feb 7, 2025
1 parent 5d67753 commit 3c5d708
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ muzzle {
dependencies {
library("org.springframework.boot:spring-boot-actuator-autoconfigure:2.0.0.RELEASE")
library("io.micrometer:micrometer-core:1.5.0")
runtimeOnly("io.micrometer:micrometer-registry-prometheus:1.0.1")

implementation(project(":instrumentation:micrometer:micrometer-1.5:javaagent"))

Expand Down Expand Up @@ -48,18 +49,4 @@ if (!latestDepTest) {
force("org.slf4j:slf4j-api:1.7.36")
}
}

// this dependency adds the old io.micrometer.prometheus.PrometheusMeterRegistry,
// which is not supported by the latest version of spring boot
tasks {
val testPrometheus by registering(Test::class) {
dependencies {
runtimeOnly("io.micrometer:micrometer-registry-prometheus:1.0.1")
}
}

check {
dependsOn(testPrometheus)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,5 @@ void shouldInjectOtelMeterRegistry() {

String last = list.get(list.size() - 1).getClass().getSimpleName();
assertThat(last).isEqualTo("OpenTelemetryMeterRegistry");

try {
Class.forName("io.micrometer.prometheusmetrics.PrometheusMeterRegistry");
assertThat(registries)
.extracting(r -> r.getClass().getSimpleName())
.contains("PrometheusMeterRegistry");
} catch (ClassNotFoundException e) {
// not testing prometheus
}
}
}

0 comments on commit 3c5d708

Please sign in to comment.