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.
Example:
val registry = new PrometheusRegistry()
val endpointResult = PrometheusEndpoint.start(9090, registry)
endpointResult match {
case Right(endpoint) =>
println(s"Metrics at: ${endpoint.url}")
// ... application runs ...
endpoint.stop()
case Left(error) =>
println(s"Failed to start: ${error.message}")
}
Value parameters
- port
-
Port the server is listening on
- server
-
Underlying HTTP server
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article