org.llm4s.metrics.PrometheusEndpoint
See thePrometheusEndpoint companion object
HTTP endpoint for exposing Prometheus metrics.
Wraps the Prometheus HTTPServer and provides lifecycle management. Use this to expose metrics at /metrics for Prometheus scraping.
Value parameters
- port
-
Port the server is listening on
- server
-
Underlying HTTP server
Attributes
- Example
-
val registry = new PrometheusRegistry() val metrics = new PrometheusMetrics(registry) PrometheusEndpoint.start(9090, registry) match { case Right(endpoint) => // Use `metrics` with LLM clients while Prometheus scrapes: // http://localhost:9090/metrics endpoint.stop() case Left(error) => println(s"Failed to start Prometheus endpoint: ${error.message}") } - Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article