Class MonitoringServerClient

java.lang.Object
com.nmontytskyi.monitoring.starter.client.MonitoringServerClient

public class MonitoringServerClient extends Object
HTTP client for communicating with the central monitoring server.

All calls are wrapped in try/catch so that monitoring failures never propagate to the client service's business logic.

  • Constructor Details

    • MonitoringServerClient

      public MonitoringServerClient(String serverUrl)
  • Method Details

    • registerService

      public Long registerService(ServiceRegistrationRequest request)
      Registers this service and returns the assigned service ID, or null on failure.
    • pushMetric

      public void pushMetric(MetricPushRequest request)
      Pushes a single metric snapshot (used by @MonitoredEndpoint path).
    • pushMetricBatch

      public void pushMetricBatch(List<MetricPushRequest> batch)
      Pushes a batch of metric snapshots in a single HTTP call. Throws on HTTP error so the caller (MetricsBuffer) can apply its re-queue fail-safe strategy.