Appearance
Metrics
From 1.6.0, the coordinator serves what each deployment is doing in the Prometheus text format, so the dashboards you already run can show it.
Where
/metrics on the console's port, 7446, over the same TLS as the console. It answers a metrics key, or the console session of an owner or an admin. Anything else is refused, and a metrics key opens nothing but /metrics.
A key for the scraper
An owner or an admin makes it, on the coordinator:
bash
sudo diffuse-coordinator apikey create --name prometheus --scope metrics > /etc/prometheus/diffuse-metrics.key
sudo cp /etc/diffuse/ca.crt /etc/prometheus/diffuse-ca.crt
sudo chown prometheus: /etc/prometheus/diffuse-metrics.key && sudo chmod 600 /etc/prometheus/diffuse-metrics.keyPrometheus sends it as a bearer and trusts the coordinator's CA:
yaml
scrape_configs:
- job_name: diffuse
scheme: https
metrics_path: /metrics
scrape_interval: 15s
authorization:
type: Bearer
credentials_file: /etc/prometheus/diffuse-metrics.key
tls_config:
ca_file: /etc/prometheus/diffuse-ca.crt
static_configs:
- targets: ["10.0.1.1:7446"]What it serves
Labels name the deployment, the replica and the node, never a person.
| Metric | Type | Labels | Meaning |
|---|---|---|---|
diffuse_replicas_wanted | gauge | deployment | replicas the deployment asks for |
diffuse_replicas_serving | gauge | deployment | replicas whose every slice serves |
diffuse_replica_batch | gauge | deployment, replica, node | sequences the engine decodes together at most |
diffuse_replica_busy | gauge | deployment, replica, node | generations running |
diffuse_replica_queued | gauge | deployment, replica, node | generations waiting on the node |
diffuse_replica_tokens_per_second | gauge | deployment, replica, node | tokens per second of generation time |
diffuse_replica_prompt_tokens_total | counter | deployment, replica, node | prompt tokens |
diffuse_replica_cached_prompt_tokens_total | counter | deployment, replica, node | prompt tokens read from the prefix cache |
deployment show <id> prints the same numbers per replica.
Ratios are computed in Prometheus
/metrics serves counters and gauges, never a ratio and never NaN. The cache hit rate of each replica, over five minutes:
promql
sum by (deployment, replica, node) (rate(diffuse_replica_cached_prompt_tokens_total[5m]))
/ (sum by (deployment, replica, node) (rate(diffuse_replica_prompt_tokens_total[5m])) > 0)A deployment serving on fewer replicas than it asks for:
promql
diffuse_replicas_serving < diffuse_replicas_wanted