Reference
Metrics
Kinference exports a variety of metrics in
Prometheus-compatible format. By default, these
metrics are available via HTTP on port 9001 under the /metrics path.
A note on per-tenant metrics #
Metrics are optionally available on a per-tenant basis, i.e. with a tenant
label. However, this can result in a large number of metrics: approximately 91
series per (model, qos, tenant) tuple. At 5 models and 3 QoS classes that is
about 1,365 series per tenant.
Per-tenant metrics are off by default, but can be configured (including via an
explicit allowlist) via the [metrics] tenant_labels configuration block:
tenant_labels | Effect |
|---|---|
omitted, "none", or [] | Default. Every request is assigned to tenant “default”. |
"all" | Every tenant id seen becomes its own label value. Unbounded–use caution. |
["acme", "globex"] | Allowlist of tenants to track; all other tenants are bucketed under “default” |
As with tenants outside of the allowlist, requests without tenant information
will also be bucketed under the tenant value of default.
Token usage metrics #
Token usage per model, QoS level, and tenant. Measured at prompt (input) and completion (output).
| Metric | Type | Labels |
|---|---|---|
bllmp_prompt_tokens_total | counter | model, qos, tenant |
bllmp_completion_tokens_total | counter | model, qos, tenant |
bllmp_prompt_length_tokens | histogram | model, qos, tenant |
bllmp_completion_length_tokens | histogram | model, qos, tenant |
bllmp_cached_prompt_tokens_total | counter | model, qos, tenant |
bllmp_cached_tokens_absent_total | counter | — |
bllmp_cached_tokens_reported_total | counter | — |
Cached tokens are tokens within the prompt that were served from the KV cache rather than requiring computation. Sophisticated token attribution / billing systems may wish to charge for only uncached prompt tokens. This field is not always reported by workers; the “absent” counter tracks the number of prompts for which it was not reported.
Latency metrics #
Response latency, per model, QoS level, and tenant. Measured at request_duration (end-to-end latency), TTFT (time to first token), and ITL (inter-token latency).
Note that TTFT and ITL metrics only populate in the presence of streaming requests.
| Metric | Type | Labels |
|---|---|---|
bllmp_request_duration_ms | histogram | model, qos, tenant |
bllmp_ttft_ms | histogram | model, qos, tenant |
bllmp_provider_ttft_ms | histogram | provider, model |
bllmp_itl_ms_bucket | counter | model, qos, le, tenant |
bllmp_itl_ms_count | counter | model, qos, tenant |
Prefix cache metrics #
Performance of KV-cache-aware load balancing.
| Metric | Type | Labels |
|---|---|---|
bllmp_prefix_requested_blocks_total | counter | model, qos |
bllmp_prefix_matched_blocks_total | counter | model, qos |
bllmp_prefix_radix_matched_blocks_total | counter | model, qos |
bllmp_prefix_match_ratio | histogram | model, qos |
bllmp_prefix_overmatch_total | counter | model, qos |
Prefix index health metrics #
The internal radix tree state, for diagnostic purposes.
| Metric | Type | Labels |
|---|---|---|
bllmp_index_blocks | gauge | — |
bllmp_index_workers | gauge | — |
bllmp_index_events_total | counter | kind |
bllmp_index_blocks_stored_total | counter | — |
bllmp_index_blocks_removed_total | counter | — |
Tokenization metrics #
| Metric | Type | Labels |
|---|---|---|
bllmp_tokenize_total | counter | path |
bllmp_tokenize_duration_ms | histogram | — |
bllmp_tokenize_compare_total | counter | result |
Where path is one of:
path | Means |
|---|---|
local | The in-process tokenizer served it |
http_fallback | Local failed; the engine’s /render saved it |
unavailable | Both failed. The pick is degraded and routes on load alone |
bllmp_tokenize_compare_total reports result as match, divergence or
error. Divergence means that Kinference’s block hashes disagree with those
reported by the engine. This is a signal that local tokenization is not
accurate. Note that this value is only non-zero when [profile.tokenize] mode
is compare.
Routing decision metrics #
| Metric | Type | Labels |
|---|---|---|
bllmp_policy_decisions_total | counter | outcome |
bllmp_policy_rule_matches_total | counter | rule |
bllmp_score_degraded_total | counter | reason |
bllmp_policy_revision_mismatch_total | counter | — |
bllmp_predicted_ttft_ms | histogram | worker, model |
bllmp_predicted_ttft_ms is the distriubtion of predicted TTFT across all
candidates scored (not just those that won). Uses the same buckets as
bllmp_ttft_ms, so the predictions are comparable.
Where outcome is one of:
outcome | Means |
|---|---|
chosen | A rule matched and picked a destination |
unmatched_served | No rule matched; the unmatched: ServeLocal route picked |
rejected_unmatched | No rule matched and unmatched: Reject |
unmatched_empty | The unmatched route had no surviving candidate |
no_destinations | The pool lists nothing routable |
unknown_pool | The caller named a pool the router has never seen |
not_listed | Same, but before the first CRD list completed. (Expected briefly at startup) |
forced_endpoint_missing | The policy chose an endpoint absent from the scored set, and the picker overruled it. |
Configuration health metrics #
| Metric | Type | Labels |
|---|---|---|
bllmp_workerset_rejected_total | counter | reason |
Number of InferenceWorkerSets rejected and the
reason, which includes: MissingProfile, UnknownProfile,
MissingKvBlockSize, InvalidKvBlockSize, MissingServiceRef,
KvEventsMissingPort, and ModelMissingName.
Request buffering metrics #
Internal metrics capturing the buffering of request bodies by Kinference, for diagnosing Kinference memory usage.
| Metric | Type | Labels |
|---|---|---|
bllmp_body_buffer_bytes | gauge | — |
bllmp_body_buffer_entries | gauge | — |
bllmp_body_pushed_total | counter | — |
bllmp_body_pushed_bytes_total | counter | — |
bllmp_body_reaped_total | counter | — |
bllmp_body_rejected_total | counter | reason |
bllmp_body_aborted_total | counter | reason |
Leadership election metrics #
| Metric | Type | Labels |
|---|---|---|
bllmp_leader | gauge | — |
bllmp_leader_transitions_total | counter | — |
bllmp_leader_election_errors_total | counter | — |
Internal metrics corresponding to Kubernetes leader election. For diagnostic purposes.
Auth and rate limiting metrics #
| Metric | Type | Labels |
|---|---|---|
bllmp_token_review_total | counter | outcome |
bllmp_rate_limit_total | counter | outcome |
Possible token_review outcomes are allowed, invalid, timeout and
transport.
Possible rate_limit outcomes are allowed, commit_ok and
commit_not_found.
Build identity metrics #
| Metric | Type | Labels |
|---|---|---|
bllmp_build_info | gauge | version |
Always 1; the information is in the version label, which matches the output
of kinference --version. Across a deployment, more than one version being
active at a time is an indication of a stalled rollout.
Router service health metrics #
Performance of Pick() gRPC call.
| Metric | Type | Labels |
|---|---|---|
bllmp_picks_total | counter | outcome |
bllmp_pick_duration_ms | histogram | outcome |
Where outcome is one of:
outcome | Means |
|---|---|
ok | A destination was chosen (including a degraded pick, which still routes) |
bad_request | The body did not parse, or carried nothing to route on |
no_workers | Nothing serves the requested model |
Note that bllmp_pick_duration_ms is Kinference’s view of the call latency, not
the client’s.
bllmp_workers reports state as either ok or unresponsive, the latter
meaning the worker’s metrics scrape has been stale for over 5 seconds.
Worker tracking statistics #
KInference’s view of workers (e.g. vLLM pods)
| Metric | Type | Labels |
|---|---|---|
bllmp_workers | gauge | state |
bllmp_workers_by_model | gauge | model, state |
bllmp_worker_evictions_total | counter | reason |
bllmp_orphaned_reports_total | counter | — |
Workers are evicted with reason block_size_mismatch when KInference receives
block sizes different form the InferenceWorkerSet’s kvBlockSize configuration.
Worker saturation statistics #
| Metric | Type | Labels |
|---|---|---|
bllmp_worker_queued_prompts_mean30s | gauge | worker, model |
bllmp_worker_kv_cache_usage_mean30s | gauge | worker, model |
These are the same values available to queuedPrompts and kvCacheUsage
candidate signals in Policies, allowing saturation thresholds to be
tuned from real data.