Skip to content

Commit

Permalink
Use Prometheus BOMs
Browse files Browse the repository at this point in the history
This commit also polishes dependencies configuration a bit along the way.
  • Loading branch information
izeye committed Sep 7, 2024
1 parent 1f1aa0a commit 6cadbde
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 34 deletions.
11 changes: 3 additions & 8 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ def VERSIONS = [
libs.grpcTestingProto,
libs.grpcKotlinStub,
libs.gmetric4j,
libs.prometheusMetrics,
libs.prometheusMetricsExpositionFormats,
libs.prometheusMetricsTracerCommon,
libs.prometheusSimpleClient,
libs.prometheusSimpleClientPushgateway,
libs.restAssured,
libs.retrofit2,
libs.jakarta.jmsApi,
Expand Down Expand Up @@ -67,8 +62,6 @@ def VERSIONS = [
libs.hibernateEntitymanager,
libs.hsqldb,
libs.jsr107,
libs.junitJupiter,
libs.junitPlatformLauncher,
libs.latencyUtils,
libs.mongoSync,
libs.postgre,
Expand All @@ -87,7 +80,9 @@ def VERSIONS = [
def PLATFORM_BOMS = [
libs.reactorBom,
libs.nettyBom,
libs.junitBom
libs.junitBom,
libs.prometheusMetricsBom,
libs.prometheusSimpleClientBom
]

subprojects {
Expand Down
2 changes: 1 addition & 1 deletion docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {
testImplementation project(':micrometer-test')
testImplementation project(':micrometer-observation-test')
testImplementation 'org.aspectj:aspectjweaver'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation libs.junitJupiter
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.springframework:spring-context'
testImplementation 'io.projectreactor:reactor-core'
Expand Down
17 changes: 9 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jooqNew = "3.19.8"
jsr107 = "1.1.1"
jsr305 = "3.0.2"
junit = "5.10.3"
junit-platform = "1.10.3"
kafka = "2.8.2"
kafka-junit = "4.2.10"
latency-utils = "2.0.3"
Expand Down Expand Up @@ -162,9 +161,9 @@ jsonPath = { module = "com.jayway.jsonpath:json-path", version = "2.9.0" }
jsr107 = { module = "org.jsr107.ri:cache-ri-impl", version.ref = "jsr107" }
jsr305 = { module = "com.google.code.findbugs:jsr305", version.ref = "jsr305" }
junitBom = { module = "org.junit:junit-bom", version.ref = "junit" }
junitJupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
junitJupiter = { module = "org.junit.jupiter:junit-jupiter" }
junitLoggingExtension = "com.innoq:junit5-logging-extension:0.2.0"
junitPlatformLauncher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junit-platform" }
junitPlatformLauncher = { module = "org.junit.platform:junit-platform-launcher" }
kafkaClients = { module = "org.apache.kafka:kafka-clients", version.ref = "kafka" }
kafkaStreams = { module = "org.apache.kafka:kafka-streams", version.ref = "kafka" }
kafkaJunit = { module = "com.github.charithe:kafka-junit", version.ref = "kafka-junit" }
Expand All @@ -187,11 +186,13 @@ okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
openTelemetry-proto = { module = "io.opentelemetry.proto:opentelemetry-proto", version = "1.2.0-alpha" }
osgiJunit5 = "org.osgi:org.osgi.test.junit5:1.3.0"
postgre = { module = "org.postgresql:postgresql", version.ref = "postgre" }
prometheusMetrics = { module = "io.prometheus:prometheus-metrics-core", version.ref = "prometheus" }
prometheusMetricsExpositionFormats = { module = "io.prometheus:prometheus-metrics-exposition-formats", version.ref = "prometheus" }
prometheusMetricsTracerCommon = { module = "io.prometheus:prometheus-metrics-tracer-common", version.ref = "prometheus" }
prometheusSimpleClient = { module = "io.prometheus:simpleclient_common", version.ref = "prometheusSimpleClient" }
prometheusSimpleClientPushgateway = { module = "io.prometheus:simpleclient_pushgateway", version.ref = "prometheusSimpleClient" }
prometheusMetricsBom = { module = "io.prometheus:prometheus-metrics-bom", version.ref = "prometheus" }
prometheusMetrics = { module = "io.prometheus:prometheus-metrics-core" }
prometheusMetricsExpositionFormats = { module = "io.prometheus:prometheus-metrics-exposition-formats" }
prometheusMetricsTracerCommon = { module = "io.prometheus:prometheus-metrics-tracer-common" }
prometheusSimpleClientBom = { module = "io.prometheus:simpleclient_bom", version.ref = "prometheusSimpleClient" }
prometheusSimpleClient = { module = "io.prometheus:simpleclient_common" }
prometheusSimpleClientPushgateway = { module = "io.prometheus:simpleclient_pushgateway" }
reactorBom = { module = "io.projectreactor:reactor-bom", version.ref = "reactor" }
restAssured = { module = "io.rest-assured:rest-assured", version.ref = "rest-assured" }
retrofit2 = { module = "com.squareup.retrofit2:retrofit", version = "2.11.0" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description = 'MeterRegistry implementation for Prometheus using io.prometheus:s
dependencies {
api project(':micrometer-core')

api 'io.prometheus:simpleclient_common'
api libs.prometheusSimpleClient

testImplementation project(':micrometer-test')
}
7 changes: 3 additions & 4 deletions implementations/micrometer-registry-prometheus/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ description = 'MeterRegistry implementation for Prometheus using io.prometheus:p
dependencies {
api project(':micrometer-core')

api('io.prometheus:prometheus-metrics-core') {
api(libs.prometheusMetrics) {
// We only need SpanContext from prometheus-metrics-tracer-common, we don't need
// prometheus-metrics-tracer-initializer nor the dependencies it pulls in
exclude(group: 'io.prometheus', module: 'prometheus-metrics-tracer-initializer')
}
api 'io.prometheus:prometheus-metrics-tracer-common'
implementation 'io.prometheus:prometheus-metrics-exposition-formats'
api libs.prometheusMetricsTracerCommon
implementation libs.prometheusMetricsExpositionFormats

testImplementation project(':micrometer-test')
testImplementation 'io.prometheus:prometheus-metrics-tracer-common'
testImplementation 'io.rest-assured:rest-assured'
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation 'org.awaitility:awaitility'
Expand Down
2 changes: 1 addition & 1 deletion micrometer-commons/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
optionalApi 'org.aspectj:aspectjweaver'

// JUnit 5
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation libs.junitJupiter
testImplementation 'org.assertj:assertj-core'
}

Expand Down
4 changes: 2 additions & 2 deletions micrometer-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ dependencies {
// testAnnotationProcessor 'com.google.dagger:dagger-compiler'

// JUnit 5
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation libs.junitJupiter
testImplementation(libs.archunitJunit5) {
// avoid transitively pulling in slf4j 2
exclude group: "org.slf4j", module: "slf4j-api"
Expand Down Expand Up @@ -196,7 +196,7 @@ dependencies {

// Dependencies for @ClassPathExclusions
testImplementation("org.junit.platform:junit-platform-engine")
testImplementation("org.junit.platform:junit-platform-launcher")
testImplementation(libs.junitPlatformLauncher)
testImplementation(libs.mavenResolverConnectorBasic)
testImplementation(libs.mavenResolverProvider) {
exclude(group: "javax.inject", module: "javax.inject")
Expand Down
2 changes: 1 addition & 1 deletion micrometer-jakarta9/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {

optionalApi 'jakarta.jms:jakarta.jms-api'

testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation libs.junitJupiter
testImplementation(libs.archunitJunit5) {
// avoid transitively pulling in slf4j 2
exclude group: "org.slf4j", module: "slf4j-api"
Expand Down
2 changes: 1 addition & 1 deletion micrometer-jetty11/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencies {
api project(":micrometer-core")
api libs.jetty11Server

testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation libs.junitJupiter
testImplementation 'org.assertj:assertj-core'
}

Expand Down
2 changes: 1 addition & 1 deletion micrometer-observation-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencies {
api project(':micrometer-observation')

api 'org.assertj:assertj-core'
api 'org.junit.jupiter:junit-jupiter'
api libs.junitJupiter

implementation libs.mockitoCore4

Expand Down
2 changes: 1 addition & 1 deletion micrometer-observation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies {
testImplementation 'org.springframework:spring-context'

// JUnit 5
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation libs.junitJupiter
testImplementation(libs.archunitJunit5) {
// avoid transitively pulling in slf4j 2
exclude group: "org.slf4j", module: "slf4j-api"
Expand Down
4 changes: 2 additions & 2 deletions micrometer-osgi-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import aQute.bnd.gradle.TestOSGi

dependencies {
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation libs.junitJupiter
testImplementation libs.osgiJunit5
testImplementation 'org.slf4j:slf4j-api'

Expand All @@ -17,7 +17,7 @@ dependencies {

testImplementation libs.felixFramework

testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testRuntimeOnly libs.junitPlatformLauncher
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly libs.felixScr
testRuntimeOnly libs.slfj4Simple
Expand Down
2 changes: 1 addition & 1 deletion micrometer-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {

api 'org.assertj:assertj-core'

api 'org.junit.jupiter:junit-jupiter'
api libs.junitJupiter
api 'org.junit.jupiter:junit-jupiter-engine'

api 'ru.lanwen.wiremock:wiremock-junit5'
Expand Down
2 changes: 1 addition & 1 deletion samples/micrometer-samples-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies {
implementation project(":micrometer-registry-$sys")
}

implementation 'io.prometheus:simpleclient_pushgateway'
implementation libs.prometheusSimpleClientPushgateway
implementation 'io.projectreactor.netty:reactor-netty-http'
implementation 'org.apache.kafka:kafka-clients'
implementation 'com.github.charithe:kafka-junit'
Expand Down
2 changes: 1 addition & 1 deletion samples/micrometer-samples-jersey3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ dependencies {
runtimeOnly libs.jersey3Hk2

testImplementation libs.jersey3TestFrameworkJdkHttp
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation libs.junitJupiter
testImplementation 'org.assertj:assertj-core'
}

0 comments on commit 6cadbde

Please sign in to comment.