Updates for new observation classes
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user