org.llm4s.metrics.PrometheusMetrics
See thePrometheusMetrics companion object
final class PrometheusMetrics(val registry: PrometheusRegistry) extends MetricsCollector
Prometheus implementation of MetricsCollector.
Tracks request volumes, token usage, errors, and latency across different providers and models using Prometheus metrics.
All operations are wrapped in try-catch to ensure metric failures never propagate to callers. This implementation is thread-safe.
Example usage:
val registry = new PrometheusRegistry()
val metrics = new PrometheusMetrics(registry)
// Use with endpoint
PrometheusEndpoint.start(9090, registry).foreach { endpoint =>
// ... use metrics ...
endpoint.stop()
}
Value parameters
- registry
-
Prometheus collector registry
Attributes
- Companion
- object
- Graph
-
- Supertypes
Members list
In this article