Metrics
Prometheus metrics, and a ready-made Grafana dashboard.
Hald serves Prometheus metrics at /metrics.
The metrics never hold the text of a request or a reply.
Prometheus
Add Hald to prometheus.yml:
scrape_configs:
- job_name: hald
scrape_interval: 5s
static_configs:
- targets: ["SPARK:8888"]
Grafana
- Download hald.json.
- In Grafana, go to Dashboards → New → Import.
- Upload the file, and choose your Prometheus data source.
The dashboard shows requests, tokens per second, time per token, waiting times, prompt reuse, draft acceptance, the prompt cache and memory.
The metrics
All names start with hald_. Most have a model label.
| Metric | Type | What it counts |
|---|---|---|
requests_total | counter | Finished requests, by outcome. |
requests | gauge | Running requests, by state. |
prompt_tokens_total | counter | Prompt tokens. |
reused_tokens_total | counter | Prompt tokens reused from earlier prompts. |
generated_tokens_total | counter | Generated tokens. |
draft_tokens_total | counter | Drafted tokens checked by the model. |
draft_accepted_tokens_total | counter | Drafted tokens the model accepted. |
request_seconds | histogram | Time from start to end of a request. |
queue_seconds | histogram | Time a request waited for its turn. |
prompt_seconds | histogram | Time to process the prompt. |
time_per_output_token_seconds | histogram | Time per generated token. |
load_seconds | histogram | Time a request waited for its model to load. |
cache_hits_total, cache_misses_total | counter | Prompt cache lookups. |
cache_used_bytes, cache_free_bytes | gauge | Prompt cache use. |
device_memory_allocated_bytes | gauge | GPU memory that Hald uses. |
model_memory_bytes | gauge | GPU memory of each model, by part. |
model_state | gauge | Whether a model is loaded. |
arena_bytes, arena_free_bytes | gauge | The shared KV arena. |
Open /metrics to see all metrics, with a help text for each.
Turn it off
Set metrics = "" in the http block. See Configuration.