Annotation 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 Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    Restricts which payload types this handler may be invoked for.
    boolean
    If true, disables this handler during discovery.
  • Element Details

    • disabled

      boolean disabled
      If true, disables this handler during discovery.
      Default:
      false
    • allowedClasses

      Class<?>[] allowedClasses
      Restricts which payload types this handler may be invoked for.
      Default:
      {}