|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2012-2022 the original author or authors.
|
|
|
|
|
* Copyright 2012-2023 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.
|
|
|
|
@ -19,6 +19,7 @@ package org.springframework.boot.actuate.autoconfigure.observation;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import io.micrometer.observation.GlobalObservationConvention;
|
|
|
|
|
import io.micrometer.observation.ObservationFilter;
|
|
|
|
|
import io.micrometer.observation.ObservationHandler;
|
|
|
|
|
import io.micrometer.observation.ObservationPredicate;
|
|
|
|
|
import io.micrometer.observation.ObservationRegistry;
|
|
|
|
@ -48,22 +49,27 @@ class ObservationRegistryConfigurer {
|
|
|
|
|
|
|
|
|
|
private final ObjectProvider<ObservationHandlerGrouping> observationHandlerGrouping;
|
|
|
|
|
|
|
|
|
|
private final ObjectProvider<ObservationFilter> observationFilters;
|
|
|
|
|
|
|
|
|
|
ObservationRegistryConfigurer(ObjectProvider<ObservationRegistryCustomizer<?>> customizers,
|
|
|
|
|
ObjectProvider<ObservationPredicate> observationPredicates,
|
|
|
|
|
ObjectProvider<GlobalObservationConvention<?>> observationConventions,
|
|
|
|
|
ObjectProvider<ObservationHandler<?>> observationHandlers,
|
|
|
|
|
ObjectProvider<ObservationHandlerGrouping> observationHandlerGrouping) {
|
|
|
|
|
ObjectProvider<ObservationHandlerGrouping> observationHandlerGrouping,
|
|
|
|
|
ObjectProvider<ObservationFilter> observationFilters) {
|
|
|
|
|
this.customizers = customizers;
|
|
|
|
|
this.observationPredicates = observationPredicates;
|
|
|
|
|
this.observationConventions = observationConventions;
|
|
|
|
|
this.observationHandlers = observationHandlers;
|
|
|
|
|
this.observationHandlerGrouping = observationHandlerGrouping;
|
|
|
|
|
this.observationFilters = observationFilters;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void configure(ObservationRegistry registry) {
|
|
|
|
|
registerObservationPredicates(registry);
|
|
|
|
|
registerGlobalObservationConventions(registry);
|
|
|
|
|
registerHandlers(registry);
|
|
|
|
|
registerFilters(registry);
|
|
|
|
|
customize(registry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -80,6 +86,10 @@ class ObservationRegistryConfigurer {
|
|
|
|
|
this.observationConventions.orderedStream().forEach(registry.observationConfig()::observationConvention);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void registerFilters(ObservationRegistry registry) {
|
|
|
|
|
this.observationFilters.orderedStream().forEach(registry.observationConfig()::observationFilter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
|
private void customize(ObservationRegistry registry) {
|
|
|
|
|
LambdaSafe.callbacks(ObservationRegistryCustomizer.class, asOrderedList(this.customizers), registry)
|
|
|
|
|