Move metric properties
- Moved from 'management.metrics.export.<product>' to 'management.<product>.metrics.export' - The default enabled property moved from 'management.metrics.export.defaults.enabled' to 'management.defaults.metrics.export.enabled' Closes gh-30381
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -47,8 +47,8 @@ class MetricsExportContextCustomizerFactory implements ContextCustomizerFactory
|
||||
@Override
|
||||
public void customizeContext(ConfigurableApplicationContext context,
|
||||
MergedContextConfiguration mergedContextConfiguration) {
|
||||
TestPropertyValues.of("management.metrics.export.defaults.enabled=false",
|
||||
"management.metrics.export.simple.enabled=true").applyTo(context);
|
||||
TestPropertyValues.of("management.defaults.metrics.export.enabled=false",
|
||||
"management.simple.metrics.export.enabled=true").applyTo(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -46,8 +46,8 @@ class AutoConfigureMetricsMissingIntegrationTests {
|
||||
|
||||
@Test
|
||||
void customizerRunsAndSetsExclusionPropertiesWhenNoAnnotationPresent(@Autowired Environment environment) {
|
||||
assertThat(environment.getProperty("management.metrics.export.defaults.enabled")).isEqualTo("false");
|
||||
assertThat(environment.getProperty("management.metrics.export.simple.enabled")).isEqualTo("true");
|
||||
assertThat(environment.getProperty("management.defaults.metrics.export.enabled")).isEqualTo("false");
|
||||
assertThat(environment.getProperty("management.simple.metrics.export.enabled")).isEqualTo("true");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -44,8 +44,8 @@ class AutoConfigureMetricsPresentIntegrationTests {
|
||||
|
||||
@Test
|
||||
void customizerDoesNotSetExclusionPropertiesWhenAnnotationPresent(@Autowired Environment environment) {
|
||||
assertThat(environment.containsProperty("management.metrics.export.enabled")).isFalse();
|
||||
assertThat(environment.containsProperty("management.metrics.export.simple.enabled")).isFalse();
|
||||
assertThat(environment.containsProperty("management.defaults.metrics.export.enabled")).isFalse();
|
||||
assertThat(environment.containsProperty("management.simple.metrics.export.enabled")).isFalse();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2022 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.
|
||||
@@ -43,9 +43,9 @@ class MetricsExportContextCustomizerFactoryTests {
|
||||
assertThat(customizer).isNotNull();
|
||||
ConfigurableApplicationContext context = new GenericApplicationContext();
|
||||
customizer.customizeContext(context, null);
|
||||
assertThat(context.getEnvironment().getProperty("management.metrics.export.defaults.enabled"))
|
||||
assertThat(context.getEnvironment().getProperty("management.defaults.metrics.export.enabled"))
|
||||
.isEqualTo("false");
|
||||
assertThat(context.getEnvironment().getProperty("management.metrics.export.simple.enabled")).isEqualTo("true");
|
||||
assertThat(context.getEnvironment().getProperty("management.simple.metrics.export.enabled")).isEqualTo("true");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user