Annotation Interface HandleMetrics
@Documented
@Retention(RUNTIME)
@Target({METHOD,CONSTRUCTOR})
@HandleMessage(METRICS)
public @interface HandleMetrics
Marks a method or constructor as a handler for internal metrics events (
MessageType.METRICS
).
Metrics messages are emitted by Flux client applications and the Flux platform to report on internal operations such as read throughput, search activity, store position updates, or handler performance. These messages are valuable for observability, debugging, auditing, and building custom monitoring or alerting systems.
This annotation allows applications to process metrics events, optionally filtered by payload type. It is a concrete
specialization of HandleMessage
for MessageType.METRICS
.
Use Cases
- Monitoring how frequently specific projections are accessed
- Tracking search volume or performance for the document store
- Building dashboards with application-specific system insights
- Capturing store/read latency or error patterns
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<?>[]
Restricts which payload types this handler may be invoked for.boolean
Iftrue
, disables this handler during discovery.
-
Element Details
-
disabled
boolean disabledIftrue
, disables this handler during discovery.- Default:
false
-
allowedClasses
Class<?>[] allowedClassesRestricts which payload types this handler may be invoked for.- Default:
{}
-