Package io.mats3.intercept.micrometer
Class MatsMicrometerInterceptor
- java.lang.Object
-
- io.mats3.intercept.micrometer.MatsMicrometerInterceptor
-
- All Implemented Interfaces:
io.mats3.api.intercept.MatsInitiateInterceptor,io.mats3.api.intercept.MatsMetricsInterceptor,io.mats3.api.intercept.MatsStageInterceptor
public class MatsMicrometerInterceptor extends java.lang.Object implements io.mats3.api.intercept.MatsMetricsInterceptor, io.mats3.api.intercept.MatsInitiateInterceptor, io.mats3.api.intercept.MatsStageInterceptorAn interceptor that instruments a MatsFactory with metrics using the (Spring) Micrometer framework. If you provide aMeterRegistry, it will employ this to create the metrics on, otherwise it employs theMetrics.globalRegistry. Note: This interceptor (Micrometer Metrics) has special support inJmsMatsFactory: If present on the classpath, it is automatically installed using theinstall(MatsInterceptable)install method. This implies that it employs theMicrometer 'globalRegistry'. If you rather want to supply a specific registry, then install a different instance using theinstall(MatsInterceptable, MeterRegistry)method - theJmsMatsFactorywill then remove the automatically installed, since it implements the special marker-interfaceMatsMetricsInterceptorof which there can only be one instance installed.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.mats3.api.intercept.MatsInitiateInterceptor
io.mats3.api.intercept.MatsInitiateInterceptor.InitiateCompletedContext, io.mats3.api.intercept.MatsInitiateInterceptor.InitiateInterceptContext, io.mats3.api.intercept.MatsInitiateInterceptor.InitiateInterceptOutgoingMessagesContext, io.mats3.api.intercept.MatsInitiateInterceptor.InitiateInterceptUserLambdaContext, io.mats3.api.intercept.MatsInitiateInterceptor.InitiateStartedContext, io.mats3.api.intercept.MatsInitiateInterceptor.MatsInitiateInterceptOutgoingMessages, io.mats3.api.intercept.MatsInitiateInterceptor.MatsInitiateInterceptUserLambda
-
Nested classes/interfaces inherited from interface io.mats3.api.intercept.MatsStageInterceptor
io.mats3.api.intercept.MatsStageInterceptor.MatsStageInterceptOutgoingMessages, io.mats3.api.intercept.MatsStageInterceptor.MatsStageInterceptUserLambda, io.mats3.api.intercept.MatsStageInterceptor.StageCommonContext, io.mats3.api.intercept.MatsStageInterceptor.StageCompletedContext, io.mats3.api.intercept.MatsStageInterceptor.StageInterceptContext, io.mats3.api.intercept.MatsStageInterceptor.StageInterceptOutgoingMessageContext, io.mats3.api.intercept.MatsStageInterceptor.StageInterceptUserLambdaContext, io.mats3.api.intercept.MatsStageInterceptor.StagePreprocessAndDeserializeErrorContext, io.mats3.api.intercept.MatsStageInterceptor.StageReceivedContext
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLOG_PREFIX
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitiateCompleted(io.mats3.api.intercept.MatsInitiateInterceptor.InitiateCompletedContext ctx)static MatsMicrometerInterceptorinstall(io.mats3.api.intercept.MatsInterceptable matsInterceptable)Installs a singleton instance ofMatsMicrometerInterceptorwhich employs theMetrics.globalRegistry, on the providedMatsInterceptable(which most probably is aMatsFactory).static MatsMicrometerInterceptorinstall(io.mats3.api.intercept.MatsInterceptable matsInterceptableMatsFactory, io.micrometer.core.instrument.MeterRegistry meterRegistry)Creates aMatsMicrometerInterceptoremploying the providedMeterRegistry, and installs it as a singleton on the providedMatsInterceptable(which most probably is aMatsFactory).voidstageCompleted(io.mats3.api.intercept.MatsStageInterceptor.StageCompletedContext ctx)voidstageReceived(io.mats3.api.intercept.MatsStageInterceptor.StageReceivedContext ctx)
-
-
-
Field Detail
-
LOG_PREFIX
public static final java.lang.String LOG_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
install
public static MatsMicrometerInterceptor install(io.mats3.api.intercept.MatsInterceptable matsInterceptableMatsFactory, io.micrometer.core.instrument.MeterRegistry meterRegistry)
Creates aMatsMicrometerInterceptoremploying the providedMeterRegistry, and installs it as a singleton on the providedMatsInterceptable(which most probably is aMatsFactory).- Parameters:
matsInterceptableMatsFactory- theMatsInterceptableto install on (probably aMatsFactory.meterRegistry- the MicrometerMeterRegistryto create meters on.- Returns:
- the
MatsMicrometerInterceptorinstance which was installed as singleton.
-
install
public static MatsMicrometerInterceptor install(io.mats3.api.intercept.MatsInterceptable matsInterceptable)
Installs a singleton instance ofMatsMicrometerInterceptorwhich employs theMetrics.globalRegistry, on the providedMatsInterceptable(which most probably is aMatsFactory).- Parameters:
matsInterceptable- theMatsInterceptableto install on (probably aMatsFactory.- Returns:
- the
MatsMicrometerInterceptorinstance which was installed as singleton.
-
initiateCompleted
public void initiateCompleted(io.mats3.api.intercept.MatsInitiateInterceptor.InitiateCompletedContext ctx)
- Specified by:
initiateCompletedin interfaceio.mats3.api.intercept.MatsInitiateInterceptor
-
stageReceived
public void stageReceived(io.mats3.api.intercept.MatsStageInterceptor.StageReceivedContext ctx)
- Specified by:
stageReceivedin interfaceio.mats3.api.intercept.MatsStageInterceptor
-
stageCompleted
public void stageCompleted(io.mats3.api.intercept.MatsStageInterceptor.StageCompletedContext ctx)
- Specified by:
stageCompletedin interfaceio.mats3.api.intercept.MatsStageInterceptor
-
-