mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge branch '1.2.x'
# Conflicts: # spring-boot-actuator/src/main/resources/META-INF/additional-spring-configuration-metadata.json # spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
This commit is contained in:
commit
59cb5cf8d9
@ -45,7 +45,7 @@ import org.springframework.web.servlet.HandlerMapping;
|
||||
@ConditionalOnClass({ Servlet.class, ServletRegistration.class,
|
||||
OncePerRequestFilter.class, HandlerMapping.class })
|
||||
@AutoConfigureAfter(MetricRepositoryAutoConfiguration.class)
|
||||
@ConditionalOnProperty(name = "endpoints.metrics.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "endpoints.metrics.filter.enabled", matchIfMissing = true)
|
||||
public class MetricFilterAutoConfiguration {
|
||||
|
||||
@Autowired
|
||||
|
@ -33,7 +33,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "endpoints.metrics", ignoreUnknownFields = false)
|
||||
@ConfigurationProperties(prefix = "endpoints.metrics")
|
||||
public class MetricsEndpoint extends AbstractEndpoint<Map<String, Object>> {
|
||||
|
||||
private final List<PublicMetrics> publicMetrics;
|
||||
|
@ -17,6 +17,12 @@
|
||||
"description": "Enable JMX export of all endpoints.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "endpoints.metrics.filter.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Enable the metrics servlet filter.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "info",
|
||||
"type": "java.util.Map<java.lang.String,java.lang.Object>",
|
||||
|
@ -180,7 +180,7 @@ public class MetricFilterAutoConfigurationTests {
|
||||
@Test
|
||||
public void skipsFilterIfPropertyDisabled() throws Exception {
|
||||
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
EnvironmentTestUtils.addEnvironment(context, "endpoints.metrics.enabled:false");
|
||||
EnvironmentTestUtils.addEnvironment(context, "endpoints.metrics.filter.enabled:false");
|
||||
context.register(Config.class, MetricFilterAutoConfiguration.class);
|
||||
context.refresh();
|
||||
assertThat(context.getBeansOfType(Filter.class).size(), equalTo(0));
|
||||
|
@ -780,6 +780,7 @@ content into your application; rather pick only the properties that you need.
|
||||
endpoints.mappings.id= # Endpoint identifier.
|
||||
endpoints.mappings.sensitive= # Mark if the endpoint exposes sensitive information.
|
||||
endpoints.metrics.enabled= # Enable the endpoint.
|
||||
endpoints.metrics.filter.enabled=true # Enable the metrics servlet filter.
|
||||
endpoints.metrics.id= # Endpoint identifier.
|
||||
endpoints.metrics.sensitive= # Mark if the endpoint exposes sensitive information.
|
||||
endpoints.shutdown.enabled= # Enable the endpoint.
|
||||
|
Loading…
Reference in New Issue
Block a user