Adjust code and POM to accomodate for micrometer/observability changes
This commit is contained in:
@@ -17,14 +17,14 @@
|
||||
package org.springframework.cloud.function.observability;
|
||||
|
||||
import io.micrometer.common.docs.KeyName;
|
||||
import io.micrometer.observation.docs.DocumentedObservation;
|
||||
import io.micrometer.observation.docs.ObservationDocumentation;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Oleg Zhurakousky
|
||||
* @since 4.0.0
|
||||
*/
|
||||
enum FunctionObservation implements DocumentedObservation {
|
||||
enum FunctionObservation implements ObservationDocumentation {
|
||||
/**
|
||||
* Observation created around a function execution.
|
||||
*/
|
||||
|
||||
@@ -66,7 +66,7 @@ public class ObservationFunctionAroundWrapper extends FunctionAroundWrapper {
|
||||
FunctionContext context = new FunctionContext(targetFunction).withInput(message);
|
||||
Object invocationMessage = context.getModifiedInput();
|
||||
Object result = Observation
|
||||
.createNotStarted(FunctionObservation.FUNCTION_OBSERVATION.getName(), context, this.observationRegistry)
|
||||
.createNotStarted(FunctionObservation.FUNCTION_OBSERVATION.getName(), () -> context, this.observationRegistry)
|
||||
.contextualName(FunctionObservation.FUNCTION_OBSERVATION.getContextualName())
|
||||
.observe(() -> {
|
||||
Object r = message == null ? targetFunction.get() : targetFunction.apply(invocationMessage);
|
||||
|
||||
Reference in New Issue
Block a user