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 gh-23381pull/23456/head
parent
9ecc548672
commit
9f21413000
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue