Start building against Micrometer 1.10.0 snapshots

See gh-30693
pull/30695/head
Marcin Grzejszczak 3 years ago committed by Stephane Nicoll
parent aecb035e99
commit 87991d93a5

@ -17,7 +17,7 @@
package org.springframework.boot.actuate.autoconfigure.observation;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.observation.Observation.GlobalTagsProvider;
import io.micrometer.observation.Observation.GlobalKeyValuesProvider;
import io.micrometer.observation.ObservationHandler;
import io.micrometer.observation.ObservationPredicate;
import io.micrometer.observation.ObservationRegistry;
@ -48,7 +48,7 @@ public class ObservationAutoConfiguration {
static ObservationRegistryPostProcessor observationRegistryPostProcessor(
ObjectProvider<ObservationRegistryCustomizer<?>> observationRegistryCustomizers,
ObjectProvider<ObservationPredicate> observationPredicates,
ObjectProvider<GlobalTagsProvider<?>> tagProviders,
ObjectProvider<GlobalKeyValuesProvider<?>> tagProviders,
ObjectProvider<ObservationHandler<?>> observationHandlers,
ObjectProvider<ObservationHandlerGrouping> observationHandlerGrouping) {
return new ObservationRegistryPostProcessor(observationRegistryCustomizers, observationPredicates, tagProviders,

@ -18,7 +18,7 @@ package org.springframework.boot.actuate.autoconfigure.observation;
import java.util.List;
import io.micrometer.observation.Observation.GlobalTagsProvider;
import io.micrometer.observation.Observation.GlobalKeyValuesProvider;
import io.micrometer.observation.ObservationHandler;
import io.micrometer.observation.ObservationPredicate;
import io.micrometer.observation.ObservationRegistry;
@ -29,7 +29,7 @@ import org.springframework.boot.util.LambdaSafe;
/**
* Configurer to apply {@link ObservationRegistryCustomizer customizers} to
* {@link ObservationRegistry observation registries}. Installs
* {@link ObservationPredicate observation predicates} and {@link GlobalTagsProvider
* {@link ObservationPredicate observation predicates} and {@link GlobalKeyValuesProvider
* global tag providers} into the {@link ObservationRegistry}. Also uses a
* {@link ObservationHandlerGrouping} to group handlers, which are then added to the
* {@link ObservationRegistry}.
@ -42,7 +42,7 @@ class ObservationRegistryConfigurer {
private final ObjectProvider<ObservationPredicate> observationPredicates;
private final ObjectProvider<GlobalTagsProvider<?>> tagProviders;
private final ObjectProvider<GlobalKeyValuesProvider<?>> tagProviders;
private final ObjectProvider<ObservationHandler<?>> observationHandlers;
@ -50,7 +50,7 @@ class ObservationRegistryConfigurer {
ObservationRegistryConfigurer(ObjectProvider<ObservationRegistryCustomizer<?>> customizers,
ObjectProvider<ObservationPredicate> observationPredicates,
ObjectProvider<GlobalTagsProvider<?>> tagProviders,
ObjectProvider<GlobalKeyValuesProvider<?>> tagProviders,
ObjectProvider<ObservationHandler<?>> observationHandlers,
ObjectProvider<ObservationHandlerGrouping> observationHandlerGrouping) {
this.customizers = customizers;
@ -79,7 +79,7 @@ class ObservationRegistryConfigurer {
private void registerGlobalTagsProvider(ObservationRegistry registry) {
this.tagProviders.orderedStream()
.forEach((tagProvider) -> registry.observationConfig().tagsProvider(tagProvider));
.forEach((tagProvider) -> registry.observationConfig().keyValuesProvider(tagProvider));
}
@SuppressWarnings("unchecked")

@ -16,7 +16,7 @@
package org.springframework.boot.actuate.autoconfigure.observation;
import io.micrometer.observation.Observation.GlobalTagsProvider;
import io.micrometer.observation.Observation.GlobalKeyValuesProvider;
import io.micrometer.observation.ObservationHandler;
import io.micrometer.observation.ObservationPredicate;
import io.micrometer.observation.ObservationRegistry;
@ -38,7 +38,7 @@ class ObservationRegistryPostProcessor implements BeanPostProcessor {
private final ObjectProvider<ObservationPredicate> observationPredicates;
private final ObjectProvider<GlobalTagsProvider<?>> tagProviders;
private final ObjectProvider<GlobalKeyValuesProvider<?>> tagProviders;
private final ObjectProvider<ObservationHandler<?>> observationHandlers;
@ -48,7 +48,7 @@ class ObservationRegistryPostProcessor implements BeanPostProcessor {
ObservationRegistryPostProcessor(ObjectProvider<ObservationRegistryCustomizer<?>> observationRegistryCustomizers,
ObjectProvider<ObservationPredicate> observationPredicates,
ObjectProvider<GlobalTagsProvider<?>> tagProviders,
ObjectProvider<GlobalKeyValuesProvider<?>> tagProviders,
ObjectProvider<ObservationHandler<?>> observationHandlers,
ObjectProvider<ObservationHandlerGrouping> observationHandlerGrouping) {
this.observationRegistryCustomizers = observationRegistryCustomizers;

@ -19,14 +19,15 @@ package org.springframework.boot.actuate.autoconfigure.observation;
import java.util.ArrayList;
import java.util.List;
import io.micrometer.common.Tag;
import io.micrometer.common.Tags;
import io.micrometer.common.KeyValue;
import io.micrometer.common.KeyValues;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tags;
import io.micrometer.core.instrument.observation.MeterObservationHandler;
import io.micrometer.core.instrument.search.MeterNotFoundException;
import io.micrometer.observation.Observation;
import io.micrometer.observation.Observation.Context;
import io.micrometer.observation.Observation.GlobalTagsProvider;
import io.micrometer.observation.Observation.GlobalKeyValuesProvider;
import io.micrometer.observation.ObservationHandler;
import io.micrometer.observation.ObservationHandler.AllMatchingCompositeObservationHandler;
import io.micrometer.observation.ObservationHandler.FirstMatchingCompositeObservationHandler;
@ -104,7 +105,7 @@ class ObservationAutoConfigurationTests {
ObservationRegistry observationRegistry = context.getBean(ObservationRegistry.class);
Context micrometerContext = new Context();
Observation.start("test-observation", micrometerContext, observationRegistry).stop();
assertThat(micrometerContext.getAllTags()).containsExactly(Tag.of("tag1", "value1"));
assertThat(micrometerContext.getAllKeyValues()).containsExactly(KeyValue.of("tag1", "value1"));
});
}
@ -164,16 +165,16 @@ class ObservationAutoConfigurationTests {
static class GlobalTagsProviders {
@Bean
GlobalTagsProvider<?> customTagsProvider() {
return new GlobalTagsProvider<>() {
Observation.GlobalKeyValuesProvider<?> customTagsProvider() {
return new GlobalKeyValuesProvider<>() {
@Override
public boolean supportsContext(Context context) {
return true;
}
@Override
public Tags getLowCardinalityTags(Context context) {
return Tags.of("tag1", "value1");
public KeyValues getLowCardinalityKeyValues(Context context) {
return KeyValues.of("tag1", "value1");
}
};
}

@ -976,7 +976,7 @@ bom {
]
}
}
library("Micrometer", "2.0.0-SNAPSHOT") {
library("Micrometer", "1.10.0-SNAPSHOT") {
group("io.micrometer") {
modules = [
"micrometer-registry-stackdriver" {

Loading…
Cancel
Save