Documentation
¶
Overview ¶
Package metrics provides Prometheus-format metrics collection and export.
Index ¶
- type Counter
- type Gauge
- type Histogram
- type Registry
- func (r *Registry) AddTokens(provider string, count int64)
- func (r *Registry) Counter(name, help string) *Counter
- func (r *Registry) Gauge(name, help string) *Gauge
- func (r *Registry) Handler() http.Handler
- func (r *Registry) Histogram(name, help string, buckets []float64) *Histogram
- func (r *Registry) IncAgentRuns(agentID string)
- func (r *Registry) IncToolCalls(toolName string)
- func (r *Registry) ObserveModelLatency(provider string, d time.Duration)
- func (r *Registry) SetActiveSessions(n float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is a monotonically increasing metric.
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
Gauge is a metric that can go up and down.
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram tracks value distributions in configurable buckets.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all Chronos metrics and serves them in Prometheus format.
func NewRegistry ¶
func NewRegistry() *Registry
NewRegistry creates a new metrics registry with pre-defined Chronos metrics.
func (*Registry) Handler ¶
Handler returns an http.Handler that serves metrics in Prometheus format.
func (*Registry) IncAgentRuns ¶
IncAgentRuns increments the agent runs counter.
func (*Registry) IncToolCalls ¶
IncToolCalls increments the tool calls counter.
func (*Registry) ObserveModelLatency ¶
ObserveModelLatency records a model call latency.
func (*Registry) SetActiveSessions ¶
SetActiveSessions sets the active session count.