Package org.mockserver.metrics
Class PrometheusRemoteWriteExporter
java.lang.Object
org.mockserver.metrics.PrometheusRemoteWriteExporter
Optional push exporter that, on a fixed interval, snapshots the same
Prometheus metrics served at
/mockserver/metrics, encodes them as a
Prometheus Remote-Write WriteRequest protobuf — v1 or v2 per
mockserver.prometheusRemoteWriteProtocolVersion (see
selectEncoder(String)) — snappy-compresses it (raw block format),
and HTTP POSTs it to a configured remote-write endpoint (Prometheus
--web.enable-remote-write-receiver, Grafana Mimir, New Relic,
VictoriaMetrics, Thanos Receive).
Off unless mockserver.prometheusRemoteWriteEnabled is set. Mirrors the
OtelMetricsExporter lifecycle and is fail-soft throughout: telemetry
must never throw into the server or prevent it from running. Remote write is
inherently cumulative (the Prometheus model) — there is no delta here.
-
Method Summary
Modifier and TypeMethodDescriptionStart the exporter if enabled in configuration, returning the running instance, ornullif disabled, mis-configured, or startup failed (fail-soft — telemetry must never prevent the server from running).voidstop()Stop pushing and release the scheduler.
-
Method Details
-
startIfEnabled
Start the exporter if enabled in configuration, returning the running instance, ornullif disabled, mis-configured, or startup failed (fail-soft — telemetry must never prevent the server from running). -
stop
public void stop()Stop pushing and release the scheduler. Safe to call once.
-