forked from spring-projects/spring-boot
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop applying MeterFilters to auto-configured composite registry
Previously, all MeterFilter beans were applied to all MeterRegistry beans. As a result, when a composite registry was auto-configured, both the composite and all of its delegates would have the same MeterFilters applied. This made it impossible for one of the delegate registries to have a locally-configured filter that would allow a meter that would be denied by one of the MeterFilter beans applied to the composite. This commit update MeterRegistryConfigurer to skips the auto-configured composite meter registry when applying MeterFilter beans to MeterRegistry beans. As a result, the composite's filters will no longer deny a meter before it reaches a delegate that would have accepted it due to one of its locally-configured filters. Closes spring-projectsgh-23381
- Loading branch information
1 parent
9ecc548
commit 9f21413
Showing
4 changed files
with
90 additions
and
5 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...ingframework/boot/actuate/autoconfigure/metrics/AutoConfiguredCompositeMeterRegistry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2012-2020 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. | ||
*/ | ||
|
||
package org.springframework.boot.actuate.autoconfigure.metrics; | ||
|
||
import java.util.List; | ||
|
||
import io.micrometer.core.instrument.Clock; | ||
import io.micrometer.core.instrument.MeterRegistry; | ||
import io.micrometer.core.instrument.composite.CompositeMeterRegistry; | ||
|
||
/** | ||
* Specialization of {@link CompositeMeterRegistry} used to identify the auto-configured | ||
* composite. | ||
* | ||
* @author Andy Wilkinson | ||
*/ | ||
class AutoConfiguredCompositeMeterRegistry extends CompositeMeterRegistry { | ||
|
||
AutoConfiguredCompositeMeterRegistry(Clock clock, List<MeterRegistry> registries) { | ||
super(clock, registries); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters