diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/DocumentedConfigObservation.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/DocumentedConfigObservation.java index f1e6a348..b3f26bfd 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/DocumentedConfigObservation.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/DocumentedConfigObservation.java @@ -19,9 +19,9 @@ package org.springframework.cloud.config.server.environment; import io.micrometer.common.docs.KeyName; import io.micrometer.observation.Observation; import io.micrometer.observation.ObservationConvention; -import io.micrometer.observation.docs.DocumentedObservation; +import io.micrometer.observation.docs.ObservationDocumentation; -enum DocumentedConfigObservation implements DocumentedObservation { +enum DocumentedConfigObservation implements ObservationDocumentation { /** * Observation created around an EnvironmentRepository. diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/ObservationEnvironmentRepositoryWrapper.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/ObservationEnvironmentRepositoryWrapper.java index fa8e322b..4f139d2f 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/ObservationEnvironmentRepositoryWrapper.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/ObservationEnvironmentRepositoryWrapper.java @@ -61,7 +61,8 @@ public final class ObservationEnvironmentRepositoryWrapper implements Environmen public Environment findOne(String application, String profile, String label) { ObservationEnvironmentRepositoryContext context = new ObservationEnvironmentRepositoryContext( this.delegate.getClass(), application, profile, label); - return DocumentedConfigObservation.ENVIRONMENT_REPOSITORY.observation(null, CONVENTION, context, this.registry) + return DocumentedConfigObservation.ENVIRONMENT_REPOSITORY + .observation(null, CONVENTION, () -> context, this.registry) .observe(() -> this.delegate.findOne(application, profile, label)); } @@ -69,7 +70,8 @@ public final class ObservationEnvironmentRepositoryWrapper implements Environmen public Environment findOne(String application, String profile, String label, boolean includeOrigin) { ObservationEnvironmentRepositoryContext context = new ObservationEnvironmentRepositoryContext( this.delegate.getClass(), application, profile, label); - return DocumentedConfigObservation.ENVIRONMENT_REPOSITORY.observation(null, CONVENTION, context, this.registry) + return DocumentedConfigObservation.ENVIRONMENT_REPOSITORY + .observation(null, CONVENTION, () -> context, this.registry) .observe(() -> this.delegate.findOne(application, profile, label, includeOrigin)); }