# HELP llmgateway_requests_total Total requests admitted for accounting today (UTC calendar day; resets at UTC midnight), by scope. AGGREGATION ACROSS REPLICAS: with Redis configured, this value is the gateway-wide total read from shared limit state and is IDENTICAL on every replica's own /metrics response — aggregate with max(), never sum(), or a multi-replica deployment overcounts by the replica count. Without Redis (the in-memory fallback), this SAME family becomes genuinely per-process instead, and sum() becomes the correct aggregation. Know which one you are running. # TYPE llmgateway_requests_total counter llmgateway_requests_total{scope_kind="user",scope_id="alice"} 0 llmgateway_requests_total{scope_kind="group",scope_id="default"} 0 llmgateway_requests_total{scope_kind="total",scope_id="all"} 0 # HELP llmgateway_tokens_total Total tokens accounted today (UTC calendar day; resets at UTC midnight), by scope and direction. AGGREGATION ACROSS REPLICAS: with Redis configured, this value is the gateway-wide total read from shared limit state and is IDENTICAL on every replica's own /metrics response — aggregate with max(), never sum(), or a multi-replica deployment overcounts by the replica count. Without Redis (the in-memory fallback), this SAME family becomes genuinely per-process instead, and sum() becomes the correct aggregation. Know which one you are running. # TYPE llmgateway_tokens_total counter llmgateway_tokens_total{scope_kind="user",scope_id="alice",direction="prompt"} 0 llmgateway_tokens_total{scope_kind="user",scope_id="alice",direction="completion"} 0 llmgateway_tokens_total{scope_kind="group",scope_id="default",direction="prompt"} 0 llmgateway_tokens_total{scope_kind="group",scope_id="default",direction="completion"} 0 llmgateway_tokens_total{scope_kind="total",scope_id="all",direction="prompt"} 0 llmgateway_tokens_total{scope_kind="total",scope_id="all",direction="completion"} 0 # HELP llmgateway_cost_micro_usd_total Total cost accounted today (UTC calendar day; resets at UTC midnight), in micro-USD (1000000 = $1), by scope. AGGREGATION ACROSS REPLICAS: with Redis configured, this value is the gateway-wide total read from shared limit state and is IDENTICAL on every replica's own /metrics response — aggregate with max(), never sum(), or a multi-replica deployment overcounts by the replica count. Without Redis (the in-memory fallback), this SAME family becomes genuinely per-process instead, and sum() becomes the correct aggregation. Know which one you are running. # TYPE llmgateway_cost_micro_usd_total counter llmgateway_cost_micro_usd_total{scope_kind="user",scope_id="alice"} 0 llmgateway_cost_micro_usd_total{scope_kind="group",scope_id="default"} 0 llmgateway_cost_micro_usd_total{scope_kind="total",scope_id="all"} 0 # HELP llmgateway_budget_consumed_ratio Fraction of a configured limit already consumed in its own window; 1.0 means fully consumed, above 1.0 means the limit has been breached. Emitted only for a scope with that particular limit configured. AGGREGATION ACROSS REPLICAS: with Redis configured, this value is the gateway-wide total read from shared limit state and is IDENTICAL on every replica's own /metrics response — aggregate with max(), never sum(), or a multi-replica deployment overcounts by the replica count. Without Redis (the in-memory fallback), this SAME family becomes genuinely per-process instead, and sum() becomes the correct aggregation. Know which one you are running. # TYPE llmgateway_budget_consumed_ratio gauge # HELP llmgateway_provider_attempts_total Total upstream attempts today (UTC calendar day; resets at UTC midnight), by provider. AGGREGATION ACROSS REPLICAS: with Redis configured, this value is the gateway-wide total read from shared limit state and is IDENTICAL on every replica's own /metrics response — aggregate with max(), never sum(), or a multi-replica deployment overcounts by the replica count. Without Redis (the in-memory fallback), this SAME family becomes genuinely per-process instead, and sum() becomes the correct aggregation. Know which one you are running. # TYPE llmgateway_provider_attempts_total counter llmgateway_provider_attempts_total{provider="alpha"} 0 llmgateway_provider_attempts_total{provider="beta"} 0 llmgateway_provider_attempts_total{provider="gamma"} 0 # HELP llmgateway_provider_failures_total Total upstream attempts today classified as a provider fault (transport error, 429, or 5xx — the same classification recordProviderAttempt/isTransient apply), by provider. AGGREGATION ACROSS REPLICAS: with Redis configured, this value is the gateway-wide total read from shared limit state and is IDENTICAL on every replica's own /metrics response — aggregate with max(), never sum(), or a multi-replica deployment overcounts by the replica count. Without Redis (the in-memory fallback), this SAME family becomes genuinely per-process instead, and sum() becomes the correct aggregation. Know which one you are running. # TYPE llmgateway_provider_failures_total counter llmgateway_provider_failures_total{provider="alpha"} 0 llmgateway_provider_failures_total{provider="beta"} 0 llmgateway_provider_failures_total{provider="gamma"} 0 # HELP llmgateway_provider_healthy 1 when the provider's discovery circuit breaker is not open (closed or half-open), 0 when open (discoveryHealthy, registry.go). AGGREGATION ACROSS REPLICAS: with redis.sharedState on, the discovery circuit breaker is shared via Redis, so every replica reports the same value and max() is correct. Without it, each replica runs its own breaker, so the value can differ per replica; use min() to surface "at least one replica sees this provider as unhealthy". sum() is meaningless for a 0/1 gauge. # TYPE llmgateway_provider_healthy gauge llmgateway_provider_healthy{provider="alpha"} 1 llmgateway_provider_healthy{provider="beta"} 1 llmgateway_provider_healthy{provider="gamma"} 1 # HELP llmgateway_provider_model_attempts_total Total upstream attempts today (UTC calendar day; resets at UTC midnight), by provider and model. Opt-in via metrics.modelLabel — see MetricsConfig's own doc comment for the cardinality trade-off. AGGREGATION ACROSS REPLICAS: with Redis configured, this value is the gateway-wide total read from shared limit state and is IDENTICAL on every replica's own /metrics response — aggregate with max(), never sum(), or a multi-replica deployment overcounts by the replica count. Without Redis (the in-memory fallback), this SAME family becomes genuinely per-process instead, and sum() becomes the correct aggregation. Know which one you are running. # TYPE llmgateway_provider_model_attempts_total counter llmgateway_provider_model_attempts_total{provider="alpha",model="a1"} 0 llmgateway_provider_model_attempts_total{provider="alpha",model="a2"} 0 llmgateway_provider_model_attempts_total{provider="beta",model="b1"} 0 llmgateway_provider_model_attempts_total{provider="gamma",model="c1"} 0 # HELP llmgateway_provider_model_failures_total Total upstream attempts today classified as a provider fault, by provider and model. Opt-in via metrics.modelLabel. AGGREGATION ACROSS REPLICAS: with Redis configured, this value is the gateway-wide total read from shared limit state and is IDENTICAL on every replica's own /metrics response — aggregate with max(), never sum(), or a multi-replica deployment overcounts by the replica count. Without Redis (the in-memory fallback), this SAME family becomes genuinely per-process instead, and sum() becomes the correct aggregation. Know which one you are running. # TYPE llmgateway_provider_model_failures_total counter llmgateway_provider_model_failures_total{provider="alpha",model="a1"} 0 llmgateway_provider_model_failures_total{provider="alpha",model="a2"} 0 llmgateway_provider_model_failures_total{provider="beta",model="b1"} 0 llmgateway_provider_model_failures_total{provider="gamma",model="c1"} 0 # HELP llmgateway_upstream_ttfb_seconds Time to first successful byte read from an upstream response body, in seconds, measured from just before the request was sent (watchdogBody, timeout.go). Meaningful as a distinct "how fast did the provider start responding" signal only for stream="true": a non-streaming provider buffers its whole completion before sending anything, so its own TTFB is approximately equal to its own llmgateway_upstream_duration_seconds and carries the same output-length contamination duration does — always split by the stream label before comparing across requests of different lengths, never averaged across it. AGGREGATION ACROSS REPLICAS: this histogram lives only in this process's memory, never in Redis, regardless of Config.Redis — each replica reports only the upstream traffic it personally handled, so aggregate with sum() (histogram_quantile over a sum()-aggregated set, for a real percentile), which is always correct for it, unlike the store-backed families above that flip between sum() and max() depending on whether Redis is configured. # TYPE llmgateway_upstream_ttfb_seconds histogram llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="0.1"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="0.25"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="0.5"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="1"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="2"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="5"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="10"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="15"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="30"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="60"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="120"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="300"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="600"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="false",le="+Inf"} 1 llmgateway_upstream_ttfb_seconds_sum{provider="alpha",stream="false"} 0.1 llmgateway_upstream_ttfb_seconds_count{provider="alpha",stream="false"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="0.1"} 0 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="0.25"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="0.5"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="1"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="2"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="5"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="10"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="15"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="30"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="60"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="120"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="300"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="600"} 1 llmgateway_upstream_ttfb_seconds_bucket{provider="alpha",stream="true",le="+Inf"} 1 llmgateway_upstream_ttfb_seconds_sum{provider="alpha",stream="true"} 0.2 llmgateway_upstream_ttfb_seconds_count{provider="alpha",stream="true"} 1 # HELP llmgateway_upstream_duration_seconds Total upstream response body duration, in seconds, from just before the request was sent to the last successful read or Close (watchdogBody, timeout.go) — covers the whole body, not just headers. Roughly TTFB + output_tokens/tokens_per_sec: a long generation legitimately takes longer than a short one on an equally healthy provider, so a raw average across requests of very different output length is not by itself a "provider degraded" signal — llmgateway_tokens_total's completion direction (this file) gives the token side of that ratio for the non-streaming population, where duration approximates total generation time. AGGREGATION ACROSS REPLICAS: this histogram lives only in this process's memory, never in Redis, regardless of Config.Redis — each replica reports only the upstream traffic it personally handled, so aggregate with sum() (histogram_quantile over a sum()-aggregated set, for a real percentile), which is always correct for it, unlike the store-backed families above that flip between sum() and max() depending on whether Redis is configured. # TYPE llmgateway_upstream_duration_seconds histogram llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="0.1"} 0 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="0.25"} 0 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="0.5"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="1"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="2"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="5"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="10"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="15"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="30"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="60"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="120"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="300"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="600"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="false",le="+Inf"} 1 llmgateway_upstream_duration_seconds_sum{provider="alpha",stream="false"} 0.3 llmgateway_upstream_duration_seconds_count{provider="alpha",stream="false"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="0.1"} 0 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="0.25"} 0 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="0.5"} 0 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="1"} 0 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="2"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="5"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="10"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="15"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="30"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="60"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="120"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="300"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="600"} 1 llmgateway_upstream_duration_seconds_bucket{provider="alpha",stream="true",le="+Inf"} 1 llmgateway_upstream_duration_seconds_sum{provider="alpha",stream="true"} 1.5 llmgateway_upstream_duration_seconds_count{provider="alpha",stream="true"} 1 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="0.1"} 0 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="0.25"} 0 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="0.5"} 0 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="1"} 0 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="2"} 0 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="5"} 0 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="10"} 0 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="15"} 0 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="30"} 0 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="60"} 0 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="120"} 0 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="300"} 0 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="600"} 0 llmgateway_upstream_duration_seconds_bucket{provider="beta",stream="false",le="+Inf"} 1 llmgateway_upstream_duration_seconds_sum{provider="beta",stream="false"} 700 llmgateway_upstream_duration_seconds_count{provider="beta",stream="false"} 1 # HELP llmgateway_upstream_model_ttfb_seconds Time to first successful byte read from an upstream response body, in seconds, by provider, stream, and model. Opt-in via metrics.modelLabel — see MetricsConfig's own doc comment for the cardinality trade-off. A separate metric name from llmgateway_upstream_ttfb_seconds (M4 fix), not the same series with an extra label, so summing one family never double-counts the other's requests. AGGREGATION ACROSS REPLICAS: this histogram lives only in this process's memory, never in Redis, regardless of Config.Redis — each replica reports only the upstream traffic it personally handled, so aggregate with sum() (histogram_quantile over a sum()-aggregated set, for a real percentile), which is always correct for it, unlike the store-backed families above that flip between sum() and max() depending on whether Redis is configured. # TYPE llmgateway_upstream_model_ttfb_seconds histogram llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="0.1"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="0.25"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="0.5"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="1"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="2"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="5"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="10"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="15"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="30"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="60"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="120"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="300"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="600"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="false",model="a1",le="+Inf"} 1 llmgateway_upstream_model_ttfb_seconds_sum{provider="alpha",stream="false",model="a1"} 0.1 llmgateway_upstream_model_ttfb_seconds_count{provider="alpha",stream="false",model="a1"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="0.1"} 0 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="0.25"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="0.5"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="1"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="2"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="5"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="10"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="15"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="30"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="60"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="120"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="300"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="600"} 1 llmgateway_upstream_model_ttfb_seconds_bucket{provider="alpha",stream="true",model="a1",le="+Inf"} 1 llmgateway_upstream_model_ttfb_seconds_sum{provider="alpha",stream="true",model="a1"} 0.2 llmgateway_upstream_model_ttfb_seconds_count{provider="alpha",stream="true",model="a1"} 1 # HELP llmgateway_upstream_model_duration_seconds Total upstream response body duration, in seconds, by provider, stream, and model. Opt-in via metrics.modelLabel. A separate metric name from llmgateway_upstream_duration_seconds (M4 fix), not the same series with an extra label, so summing one family never double-counts the other's requests. AGGREGATION ACROSS REPLICAS: this histogram lives only in this process's memory, never in Redis, regardless of Config.Redis — each replica reports only the upstream traffic it personally handled, so aggregate with sum() (histogram_quantile over a sum()-aggregated set, for a real percentile), which is always correct for it, unlike the store-backed families above that flip between sum() and max() depending on whether Redis is configured. # TYPE llmgateway_upstream_model_duration_seconds histogram llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="0.1"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="0.25"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="0.5"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="1"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="2"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="5"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="10"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="15"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="30"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="60"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="120"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="300"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="600"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="false",model="a1",le="+Inf"} 1 llmgateway_upstream_model_duration_seconds_sum{provider="alpha",stream="false",model="a1"} 0.3 llmgateway_upstream_model_duration_seconds_count{provider="alpha",stream="false",model="a1"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="0.1"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="0.25"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="0.5"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="1"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="2"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="5"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="10"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="15"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="30"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="60"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="120"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="300"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="600"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="alpha",stream="true",model="a1",le="+Inf"} 1 llmgateway_upstream_model_duration_seconds_sum{provider="alpha",stream="true",model="a1"} 1.5 llmgateway_upstream_model_duration_seconds_count{provider="alpha",stream="true",model="a1"} 1 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="0.1"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="0.25"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="0.5"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="1"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="2"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="5"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="10"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="15"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="30"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="60"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="120"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="300"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="600"} 0 llmgateway_upstream_model_duration_seconds_bucket{provider="beta",stream="false",model="b1",le="+Inf"} 1 llmgateway_upstream_model_duration_seconds_sum{provider="beta",stream="false",model="b1"} 700 llmgateway_upstream_model_duration_seconds_count{provider="beta",stream="false",model="b1"} 1 # HELP llmgateway_usage_provenance_requests_total Total accounted candidate outcomes (a successful upstream response, callErr == nil, that reached usage accounting in runUnified, routes_unified.go), by provider and provenance. provenance is "reported" (the provider returned real usage), "estimated" (a non-streaming response carried none, so prompt was substituted with ceil(len(body)/4) and completion billed as zero — usage.estimated, limits.go), or "unbilled" (a streaming response carried none, so the request is counted but zero tokens are billed). This family only reports how an already-billed number was arrived at; it never changes what gets billed. AGGREGATION ACROSS REPLICAS: this counter lives only in this process's memory, never in Redis, regardless of Config.Redis — aggregate with sum(), which is always correct for it, unlike the store-backed families above. # TYPE llmgateway_usage_provenance_requests_total counter llmgateway_usage_provenance_requests_total{provider="alpha",provenance="reported"} 1 llmgateway_usage_provenance_requests_total{provider="beta",provenance="estimated"} 1 llmgateway_usage_provenance_requests_total{provider="beta",provenance="unbilled"} 1 # HELP llmgateway_usage_provenance_tokens_total Total tokens billed under each provenance (the SAME result.total() runUnified already passed to accounting, routes_unified.go — never a second, independent count), by provider and provenance. sum(...{provenance="reported"}) / sum(...) across every provenance is the fraction of billed tokens that came from real provider-reported usage. AGGREGATION ACROSS REPLICAS: this counter lives only in this process's memory, never in Redis, regardless of Config.Redis — aggregate with sum(), which is always correct for it, unlike the store-backed families above. # TYPE llmgateway_usage_provenance_tokens_total counter llmgateway_usage_provenance_tokens_total{provider="alpha",provenance="reported"} 15 llmgateway_usage_provenance_tokens_total{provider="beta",provenance="estimated"} 7 llmgateway_usage_provenance_tokens_total{provider="beta",provenance="unbilled"} 0 # HELP llmgateway_router_requests_total Smart router requests by router, first attempted tier and routing reason (score, keyword, floor, model, default, or skipped when lower tiers had no usable target). AGGREGATION ACROSS REPLICAS: this counter lives only in this process's memory, never in Redis, regardless of Config.Redis — aggregate with sum(), which is always correct for it, unlike the store-backed families above. # TYPE llmgateway_router_requests_total counter llmgateway_router_requests_total{router="auto",tier="t0",reason="score"} 1 llmgateway_router_requests_total{router="auto",tier="t1",reason="keyword"} 1 # HELP llmgateway_router_decision_total Smart router decision-model calls by router and outcome (agree, override, lowconf, timeout, error, breaker, cache). AGGREGATION ACROSS REPLICAS: this counter lives only in this process's memory, never in Redis, regardless of Config.Redis — aggregate with sum(), which is always correct for it, unlike the store-backed families above. # TYPE llmgateway_router_decision_total counter llmgateway_router_decision_total{router="auto",outcome="override"} 1 # HELP llmgateway_router_decision_tiers_total Smart router answers from the decision model or its cache by router, heuristic tier and model-ranked tier. AGGREGATION ACROSS REPLICAS: this counter lives only in this process's memory, never in Redis, regardless of Config.Redis — aggregate with sum(), which is always correct for it, unlike the store-backed families above. # TYPE llmgateway_router_decision_tiers_total counter llmgateway_router_decision_tiers_total{router="auto",heuristic="t0",model="t1"} 1 # HELP llmgateway_router_escalations_total Smart router attempts that moved to a higher tier after a failure, by router, from_tier and to_tier. Same-tier failover is not counted. AGGREGATION ACROSS REPLICAS: this counter lives only in this process's memory, never in Redis, regardless of Config.Redis — aggregate with sum(), which is always correct for it, unlike the store-backed families above. # TYPE llmgateway_router_escalations_total counter llmgateway_router_escalations_total{router="auto",from_tier="t0",to_tier="t1"} 1 # HELP llmgateway_prompt_cache_tokens_total Prompt tokens by provider, model and kind (read: served from the provider prompt cache, write: written to it, uncached: neither). AGGREGATION ACROSS REPLICAS: this counter lives only in this process's memory, never in Redis, regardless of Config.Redis — aggregate with sum(), which is always correct for it, unlike the store-backed families above. # TYPE llmgateway_prompt_cache_tokens_total counter llmgateway_prompt_cache_tokens_total{provider="alpha",model="a1",kind="read"} 8 llmgateway_prompt_cache_tokens_total{provider="alpha",model="a1",kind="uncached"} 2 llmgateway_prompt_cache_tokens_total{provider="beta",model="b1",kind="uncached"} 20 # HELP llmgateway_rate_limit_rejections_total Total requests refused by a rate or budget limit since process start, by scope. Unlike the request/token/cost counters above, this is a process-lifetime counter, not UTC-day-windowed, but it does NOT reset only on restart: a scope's own count resets to 0 when that user is removed via a hot-reloaded users file, and every tracked scope resets together, in one bulk cliff (not a graceful per-scope decay), the instant more than 2000 distinct scopes have ever been seen — a value that drops is one of these events, not a scrape anomaly. AGGREGATION ACROSS REPLICAS: this counter lives only in this process's memory, never in Redis, regardless of Config.Redis — aggregate with sum(), which is always correct for it, unlike the store-backed families above. # TYPE llmgateway_rate_limit_rejections_total counter llmgateway_rate_limit_rejections_total{scope_kind="user",scope_id="alice"} 2