Skip to content

Commit df78105

Browse files
committed
Merge branch '2.2.x' into 2.3.x
Closes gh-22930
2 parents d0662e8 + 70f1216 commit df78105

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -123,6 +123,12 @@ void allowsCustomScrapeEndpointToBeUsed() {
123123
.hasBean("customEndpoint").hasSingleBean(PrometheusScrapeEndpoint.class));
124124
}
125125

126+
@Test
127+
void pushGatewayIsNotConfiguredWhenEnabledFlagIsNotSet() {
128+
this.contextRunner.withUserConfiguration(BaseConfiguration.class)
129+
.run((context) -> assertThat(context).doesNotHaveBean(PrometheusPushGatewayManager.class));
130+
}
131+
126132
@Test
127133
void withPushGatewayEnabled(CapturedOutput output) {
128134
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
@@ -1723,8 +1723,9 @@ To enable Prometheus Pushgateway support, add the following dependency to your p
17231723
</dependency>
17241724
----
17251725

1726-
When the Prometheus Pushgateway dependency is present on the classpath, Spring Boot auto-configures a `PrometheusPushGatewayManager` bean.
1726+
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.
17271727
This manages the pushing of metrics to a Prometheus Pushgateway.
1728+
17281729
The `PrometheusPushGatewayManager` can be tuned using properties under `management.metrics.export.prometheus.pushgateway`.
17291730
For advanced configuration, you can also provide your own `PrometheusPushGatewayManager` bean.
17301731

0 commit comments

Comments
 (0)