Interface MetricsReporter


public interface MetricsReporter
Contract for a component that sends collected metrics to the monitoring-server.

Implemented in monitoring-spring-boot-starter by HttpMetricsReporter, which performs HTTP POST requests to the server's REST API. Supports both single snapshot delivery and batch delivery to reduce network overhead.

Implementations must be resilient to temporary server unavailability: on delivery failure, metrics should be buffered and resent once the connection is restored.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Sends a single technical metric snapshot to the monitoring server.
    void
    Sends a batch of technical snapshots in a single HTTP request.
    void
    Sends a single business metric to the monitoring server.
  • Method Details

    • report

      void report(MetricSnapshot snapshot)
      Sends a single technical metric snapshot to the monitoring server.
      Parameters:
      snapshot - snapshot of a service state or a specific endpoint state
    • reportBatch

      void reportBatch(List<MetricSnapshot> snapshots)
      Sends a batch of technical snapshots in a single HTTP request. Used to reduce network overhead during buffered delivery.
      Parameters:
      snapshots - list of snapshots to send
    • reportBusiness

      void reportBusiness(BusinessMetric metric)
      Sends a single business metric to the monitoring server. Invoked by the AOP aspect after each successful execution of a method annotated with TrackBusinessMetric.
      Parameters:
      metric - business metric to send