Skip to content

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.key

Prometheus 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.

MetricTypeLabelsMeaning
diffuse_replicas_wantedgaugedeploymentreplicas the deployment asks for
diffuse_replicas_servinggaugedeploymentreplicas whose every slice serves
diffuse_replica_batchgaugedeployment, replica, nodesequences the engine decodes together at most
diffuse_replica_busygaugedeployment, replica, nodegenerations running
diffuse_replica_queuedgaugedeployment, replica, nodegenerations waiting on the node
diffuse_replica_tokens_per_secondgaugedeployment, replica, nodetokens per second of generation time
diffuse_replica_prompt_tokens_totalcounterdeployment, replica, nodeprompt tokens
diffuse_replica_cached_prompt_tokens_totalcounterdeployment, replica, nodeprompt 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

Diffuse Enterprise is commercial software. Diffuse Open is AGPL-3.0.