Class MicrometerInterceptorFactory
java.lang.Object
dev.restate.sdk.interceptor.micrometer.MicrometerInterceptorFactory
- All Implemented Interfaces:
HandlerInterceptor.Factory,RunInterceptor.Factory
public final class MicrometerInterceptorFactory
extends Object
implements HandlerInterceptor.Factory, RunInterceptor.Factory
Micrometer Observation interceptor factory for Java handlers. Implements both
HandlerInterceptor.Factory and RunInterceptor.Factory so a single registration covers
both invocation- and run-level observations.
Spans produced through the Micrometer → tracing bridge mirror those emitted by
sdk-interceptor-opentelemetry: attempt <target> for the handler and run (<name>)
for each ctx.run, with restate.invocation.id, restate.invocation.target,
and restate.run.name attributes.
Observation scope is thread-local. Use with MicrometerRunContextPropagator (registered
via SPI by default) to propagate spans to run closures.
-
Constructor Summary
ConstructorsConstructorDescriptionMicrometerInterceptorFactory(io.micrometer.observation.ObservationRegistry registry) -
Method Summary
Modifier and TypeMethodDescription@Nullable HandlerInterceptorCreateHandlerInterceptor.@Nullable RunInterceptorCreateRunInterceptor.
-
Constructor Details
-
MicrometerInterceptorFactory
public MicrometerInterceptorFactory(io.micrometer.observation.ObservationRegistry registry)
-
-
Method Details
-
createHandlerInterceptor
Description copied from interface:HandlerInterceptor.FactoryCreateHandlerInterceptor. Invoked once at endpoint initialization, hence the resulting interceptor is cached and reused across all invocations.Return
nullto skip this factory.- Specified by:
createHandlerInterceptorin interfaceHandlerInterceptor.Factory
-
createRunInterceptor
Description copied from interface:RunInterceptor.FactoryCreateRunInterceptor. Invoked once at endpoint initialization, hence the resulting interceptor is cached and reused across all invocations.Return
nullto skip this factory.- Specified by:
createRunInterceptorin interfaceRunInterceptor.Factory
-