Skip to content

Commit 42ca62b

Browse files
committed
Merge branch '2.3.x'
Closes gh-22931
2 parents 71d2a83 + df78105 commit 42ca62b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ void allowsCustomScrapeEndpointToBeUsed() {
140140
.hasBean("customEndpoint").hasSingleBean(PrometheusScrapeEndpoint.class));
141141
}
142142

143+
@Test
144+
void pushGatewayIsNotConfiguredWhenEnabledFlagIsNotSet() {
145+
this.contextRunner.withUserConfiguration(BaseConfiguration.class)
146+
.run((context) -> assertThat(context).doesNotHaveBean(PrometheusPushGatewayManager.class));
147+
}
148+
143149
@Test
144150
void withPushGatewayEnabled(CapturedOutput output) {
145151
this.contextRunner.withConfiguration(AutoConfigurations.of(ManagementContextAutoConfiguration.class))

spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1741,8 +1741,9 @@ To enable Prometheus Pushgateway support, add the following dependency to your p
17411741
</dependency>
17421742
----
17431743
1744-
When the Prometheus Pushgateway dependency is present on the classpath, Spring Boot auto-configures a `PrometheusPushGatewayManager` bean.
1744+
When the Prometheus Pushgateway dependency is present on the classpath and the configprop:management.metrics.export.prometheus.pushgateway.enabled[] property is set to `true`, a `PrometheusPushGatewayManager` bean is auto-configured.
17451745
This manages the pushing of metrics to a Prometheus Pushgateway.
1746+
17461747
The `PrometheusPushGatewayManager` can be tuned using properties under `management.metrics.export.prometheus.pushgateway`.
17471748
For advanced configuration, you can also provide your own `PrometheusPushGatewayManager` bean.
17481749

0 commit comments

Comments
 (0)