installPrometheusMetrics
Installs Prometheus metrics collection into the Ktor Application.
This function sets up instrumentation to collect HTTP request metrics and exposes them via a configurable HTTP endpoint for Prometheus to scrape.
Metrics collected:
http_requests_total{method, path}: total count of all HTTP requests receivedhttp_requests_errors_total{method, status_code, path}: total count of HTTP error responses (status 400-500)http_exceptions_total{method, path, exception_class}: total count of exceptions thrown during request handling
Endpoint:
Exposes metrics at the path specified in PrometheusConfig.metricsPath (default
/metrics).
Parameters
Optional PrometheusExporter instance to use for metrics registration and scraping. Defaults to a new exporter with the default collector registry.
Lambda to configure PrometheusConfig options such as endpoint path and exposure.