PrometheusEndpoint

org.llm4s.metrics.PrometheusEndpoint
See thePrometheusEndpoint companion object
final class PrometheusEndpoint

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 Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def stop(): Unit

Stop the HTTP server. Safe to call multiple times.

Stop the HTTP server. Safe to call multiple times.

Attributes

def url: String

Get the metrics endpoint URL.

Get the metrics endpoint URL.

Attributes

Concrete fields

val port: Int