diff options
Diffstat (limited to 'docs/backends/prometheus.rst')
-rw-r--r-- | docs/backends/prometheus.rst | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/docs/backends/prometheus.rst b/docs/backends/prometheus.rst index a86b6e6..8b89a23 100644 --- a/docs/backends/prometheus.rst +++ b/docs/backends/prometheus.rst @@ -13,6 +13,18 @@ The Prometheus backend wraps any other backend, for example:: implicit val sttpBackend = PrometheusBackend(AkkaHttpBackend()) -It uses by default ``sttp_request_latency`` histogram name, defined in ``PrometheusBackend.DefaultHistogramName``. It is possible to define custom histograms name by passing function mapping request to histogram name:: +It gathers request execution times in ``Histogram``. It uses by default ``sttp_request_latency`` name, defined in ``PrometheusBackend.DefaultHistogramName``. It is possible to define custom histograms name by passing function mapping request to histogram name:: - implicit val sttpBackend = PrometheusBackend(AkkaHttpBackend(), Some(request => request.uri.toString))
\ No newline at end of file + implicit val sttpBackend = PrometheusBackend(AkkaHttpBackend(), request => Some(request.uri.host)) + +You can disable request histograms by passing ``None`` returning function:: + + implicit val sttpBackend = PrometheusBackend(AkkaHttpBackend(), _ => None) + +This backend also offers ``Gauge`` with currently in-progress requests number. It uses by default ``sttp_requests_in_progress`` name, defined in ``PrometheusBackend.DefaultRequestsInProgressGaugeName``. It is possible to define custom gauge name by passing function mapping request to gauge name:: + + implicit val sttpBackend = PrometheusBackend(AkkaHttpBackend(), requestToHistogramNameMapper = request => Some(request.uri.host)) + +You can disable request in-progress gauges by passing ``None`` returning function:: + + implicit val sttpBackend = PrometheusBackend(AkkaHttpBackend(), requestToInProgressGaugeNameMapper = _ => None)
\ No newline at end of file |