Skip to main content

Module metrics

Module metrics 

Source
Expand description

Lightweight Prometheus-compatible metrics registry.

Provides thread-safe counters, gauges, and histograms without heavy external dependencies. All metric types use atomics and DashMap for lock-free concurrent access. The registry can export its state in Prometheus text exposition format via MetricsRegistry::export_prometheus.

Structs§

Histogram
A histogram that tracks the distribution of observed values across pre-defined buckets.
MetricsRegistry
A lightweight, thread-safe metrics registry that can export its state in Prometheus text format.

Constants§

ACTIVE_BOUTS
Open bout sessions.
ACTIVE_FIGHTERS
Currently active fighters.
ACTIVE_GORILLAS
Currently active gorillas.
ERRORS_TOTAL
Errors by type.
FIGHTER_SPAWNS_TOTAL
Fighters spawned.
GORILLA_RUNS_TOTAL
Gorilla runs.
LLM_CALLS_TOTAL
Total LLM calls, labeled by provider + model.
LLM_LATENCY_SECONDS
LLM call latency.
MEMORY_ENTRIES
Total memory entries.
MESSAGES_TOTAL
Messages processed.
QUEUE_DEPTH
Task queue depth.
REQUESTS_TOTAL
Total API requests, labeled by method + path + status.
REQUEST_DURATION_SECONDS
API request latency.
TOKENS_INPUT_TOTAL
Total input tokens consumed.
TOKENS_OUTPUT_TOTAL
Total output tokens consumed.
TOOL_EXECUTIONS_TOTAL
Total tool executions, labeled by tool_name + result.
TOOL_EXECUTION_SECONDS
Tool execution time.

Functions§

register_default_metrics
Register all well-known Punch metrics with help text.