From 4af532b8eedb8af108dc21229f92684455fb84a7 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Tue, 18 Nov 2025 09:08:04 +0100 Subject: [PATCH] Add starters for Micrometer Metrics This commit adds spring-boot-starter-micrometer-metrics and spring-boot-starter-micrometer-metrics-test. It also uses the new starters in smoke tests and in other starters, which depended on spring-boot-micrometer-metrics. Closes gh-48161 --- .../spring-boot-dependencies/build.gradle | 2 ++ settings.gradle | 2 ++ .../build.gradle | 2 +- .../build.gradle | 3 +- .../spring-boot-starter-actuator/build.gradle | 2 +- .../build.gradle | 28 +++++++++++++++++++ .../build.gradle | 27 ++++++++++++++++++ .../build.gradle | 2 +- .../build.gradle | 2 +- 9 files changed, 64 insertions(+), 6 deletions(-) create mode 100644 starter/spring-boot-starter-micrometer-metrics-test/build.gradle create mode 100644 starter/spring-boot-starter-micrometer-metrics/build.gradle diff --git a/platform/spring-boot-dependencies/build.gradle b/platform/spring-boot-dependencies/build.gradle index 45fb9ef584a..efb3bb20b20 100644 --- a/platform/spring-boot-dependencies/build.gradle +++ b/platform/spring-boot-dependencies/build.gradle @@ -2205,6 +2205,8 @@ bom { "spring-boot-starter-logging", "spring-boot-starter-mail", "spring-boot-starter-mail-test", + "spring-boot-starter-micrometer-metrics", + "spring-boot-starter-micrometer-metrics-test", "spring-boot-starter-mongodb", "spring-boot-starter-mongodb-test", "spring-boot-starter-mustache", diff --git a/settings.gradle b/settings.gradle index 8496e2ac059..584dce4e0f9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -303,6 +303,8 @@ include "starter:spring-boot-starter-logback" include "starter:spring-boot-starter-logging" include "starter:spring-boot-starter-mail" include "starter:spring-boot-starter-mail-test" +include "starter:spring-boot-starter-micrometer-metrics" +include "starter:spring-boot-starter-micrometer-metrics-test" include "starter:spring-boot-starter-mongodb" include "starter:spring-boot-starter-mongodb-test" include "starter:spring-boot-starter-mustache" diff --git a/smoke-test/spring-boot-smoke-test-prometheus/build.gradle b/smoke-test/spring-boot-smoke-test-prometheus/build.gradle index 80ad73d6f72..14cc6911a59 100644 --- a/smoke-test/spring-boot-smoke-test-prometheus/build.gradle +++ b/smoke-test/spring-boot-smoke-test-prometheus/build.gradle @@ -28,7 +28,7 @@ dependencies { runtimeOnly('io.micrometer:micrometer-registry-prometheus') - testImplementation(project(":module:spring-boot-micrometer-metrics-test")) + testImplementation(project(":starter:spring-boot-starter-micrometer-metrics-test")) testImplementation(project(":starter:spring-boot-starter-webmvc-test")) } diff --git a/starter/spring-boot-starter-actuator-test/build.gradle b/starter/spring-boot-starter-actuator-test/build.gradle index 7396b6b26c0..a72d785b70d 100644 --- a/starter/spring-boot-starter-actuator-test/build.gradle +++ b/starter/spring-boot-starter-actuator-test/build.gradle @@ -23,6 +23,5 @@ description = "Starter for testing Spring Boot's Actuator which provides product dependencies { api(project(":starter:spring-boot-starter-actuator")) api(project(":starter:spring-boot-starter-test")) - - api(project(":module:spring-boot-micrometer-metrics-test")) + api(project(":starter:spring-boot-starter-micrometer-metrics-test")) } diff --git a/starter/spring-boot-starter-actuator/build.gradle b/starter/spring-boot-starter-actuator/build.gradle index beccdddd57c..11e7e858874 100644 --- a/starter/spring-boot-starter-actuator/build.gradle +++ b/starter/spring-boot-starter-actuator/build.gradle @@ -22,10 +22,10 @@ description = "Starter for using Spring Boot's Actuator which provides productio dependencies { api(project(":starter:spring-boot-starter")) + api(project(":starter:spring-boot-starter-micrometer-metrics")) api(project(":module:spring-boot-actuator-autoconfigure")) api(project(":module:spring-boot-health")) - api(project(":module:spring-boot-micrometer-metrics")) api("io.micrometer:micrometer-observation") api("io.micrometer:micrometer-jakarta9") diff --git a/starter/spring-boot-starter-micrometer-metrics-test/build.gradle b/starter/spring-boot-starter-micrometer-metrics-test/build.gradle new file mode 100644 index 00000000000..e66b605f3c7 --- /dev/null +++ b/starter/spring-boot-starter-micrometer-metrics-test/build.gradle @@ -0,0 +1,28 @@ +/* + * Copyright 2012-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id "org.springframework.boot.starter" +} + +description = "Starter for testing Micrometer Metrics" + +dependencies { + api(project(":starter:spring-boot-starter-micrometer-metrics")) + api(project(":starter:spring-boot-starter-test")) + + api(project(":module:spring-boot-micrometer-metrics-test")) +} diff --git a/starter/spring-boot-starter-micrometer-metrics/build.gradle b/starter/spring-boot-starter-micrometer-metrics/build.gradle new file mode 100644 index 00000000000..2a2cad2db4d --- /dev/null +++ b/starter/spring-boot-starter-micrometer-metrics/build.gradle @@ -0,0 +1,27 @@ +/* + * Copyright 2012-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id "org.springframework.boot.starter" +} + +description = "Starter for using Micrometer Metrics" + +dependencies { + api(project(":starter:spring-boot-starter")) + + api(project(":module:spring-boot-micrometer-metrics")) +} diff --git a/starter/spring-boot-starter-opentelemetry-test/build.gradle b/starter/spring-boot-starter-opentelemetry-test/build.gradle index 1818565c651..1b2f4df2c20 100644 --- a/starter/spring-boot-starter-opentelemetry-test/build.gradle +++ b/starter/spring-boot-starter-opentelemetry-test/build.gradle @@ -23,7 +23,7 @@ description = "Starter for testing OpenTelemetry" dependencies { api(project(":starter:spring-boot-starter-opentelemetry")) api(project(":starter:spring-boot-starter-test")) + api(project(":starter:spring-boot-starter-micrometer-metrics-test")) - api(project(":module:spring-boot-micrometer-metrics-test")) api(project(":module:spring-boot-micrometer-tracing-test")) } diff --git a/starter/spring-boot-starter-opentelemetry/build.gradle b/starter/spring-boot-starter-opentelemetry/build.gradle index 2b879db4b2e..233326515b6 100644 --- a/starter/spring-boot-starter-opentelemetry/build.gradle +++ b/starter/spring-boot-starter-opentelemetry/build.gradle @@ -22,7 +22,7 @@ description = "Starter for using OpenTelemetry" dependencies { api(project(":starter:spring-boot-starter")) - api(project(":module:spring-boot-micrometer-metrics")) + api(project(":starter:spring-boot-starter-micrometer-metrics")) api(project(":module:spring-boot-micrometer-tracing-opentelemetry")) api(project(":module:spring-boot-opentelemetry"))