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_labelsEffect
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).

MetricTypeLabels
bllmp_prompt_tokens_totalcountermodel, qos, tenant
bllmp_completion_tokens_totalcountermodel, qos, tenant
bllmp_prompt_length_tokenshistogrammodel, qos, tenant
bllmp_completion_length_tokenshistogrammodel, qos, tenant
bllmp_cached_prompt_tokens_totalcountermodel, qos, tenant
bllmp_cached_tokens_absent_totalcounter—
bllmp_cached_tokens_reported_totalcounter—

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.

MetricTypeLabels
bllmp_request_duration_mshistogrammodel, qos, tenant
bllmp_ttft_mshistogrammodel, qos, tenant
bllmp_provider_ttft_mshistogramprovider, model
bllmp_itl_ms_bucketcountermodel, qos, le, tenant
bllmp_itl_ms_countcountermodel, qos, tenant

Prefix cache metrics #

Performance of KV-cache-aware load balancing.

MetricTypeLabels
bllmp_prefix_requested_blocks_totalcountermodel, qos
bllmp_prefix_matched_blocks_totalcountermodel, qos
bllmp_prefix_radix_matched_blocks_totalcountermodel, qos
bllmp_prefix_match_ratiohistogrammodel, qos
bllmp_prefix_overmatch_totalcountermodel, qos

Prefix index health metrics #

The internal radix tree state, for diagnostic purposes.

MetricTypeLabels
bllmp_index_blocksgauge—
bllmp_index_workersgauge—
bllmp_index_events_totalcounterkind
bllmp_index_blocks_stored_totalcounter—
bllmp_index_blocks_removed_totalcounter—

Tokenization metrics #

MetricTypeLabels
bllmp_tokenize_totalcounterpath
bllmp_tokenize_duration_mshistogram—
bllmp_tokenize_compare_totalcounterresult

Where path is one of:

pathMeans
localThe in-process tokenizer served it
http_fallbackLocal failed; the engine’s /render saved it
unavailableBoth 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 #

MetricTypeLabels
bllmp_policy_decisions_totalcounteroutcome
bllmp_policy_rule_matches_totalcounterrule
bllmp_score_degraded_totalcounterreason
bllmp_policy_revision_mismatch_totalcounter—
bllmp_predicted_ttft_mshistogramworker, 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:

outcomeMeans
chosenA rule matched and picked a destination
unmatched_servedNo rule matched; the unmatched: ServeLocal route picked
rejected_unmatchedNo rule matched and unmatched: Reject
unmatched_emptyThe unmatched route had no surviving candidate
no_destinationsThe pool lists nothing routable
unknown_poolThe caller named a pool the router has never seen
not_listedSame, but before the first CRD list completed. (Expected briefly at startup)
forced_endpoint_missingThe policy chose an endpoint absent from the scored set, and the picker overruled it.

Configuration health metrics #

MetricTypeLabels
bllmp_workerset_rejected_totalcounterreason

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.

MetricTypeLabels
bllmp_body_buffer_bytesgauge—
bllmp_body_buffer_entriesgauge—
bllmp_body_pushed_totalcounter—
bllmp_body_pushed_bytes_totalcounter—
bllmp_body_reaped_totalcounter—
bllmp_body_rejected_totalcounterreason
bllmp_body_aborted_totalcounterreason

Leadership election metrics #

MetricTypeLabels
bllmp_leadergauge—
bllmp_leader_transitions_totalcounter—
bllmp_leader_election_errors_totalcounter—

Internal metrics corresponding to Kubernetes leader election. For diagnostic purposes.

Auth and rate limiting metrics #

MetricTypeLabels
bllmp_token_review_totalcounteroutcome
bllmp_rate_limit_totalcounteroutcome

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 #

MetricTypeLabels
bllmp_build_infogaugeversion

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.

MetricTypeLabels
bllmp_picks_totalcounteroutcome
bllmp_pick_duration_mshistogramoutcome

Where outcome is one of:

outcomeMeans
okA destination was chosen (including a degraded pick, which still routes)
bad_requestThe body did not parse, or carried nothing to route on
no_workersNothing 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)

MetricTypeLabels
bllmp_workersgaugestate
bllmp_workers_by_modelgaugemodel, state
bllmp_worker_evictions_totalcounterreason
bllmp_orphaned_reports_totalcounter—

Workers are evicted with reason block_size_mismatch when KInference receives block sizes different form the InferenceWorkerSet’s kvBlockSize configuration.

Worker saturation statistics #

MetricTypeLabels
bllmp_worker_queued_prompts_mean30sgaugeworker, model
bllmp_worker_kv_cache_usage_mean30sgaugeworker, model

These are the same values available to queuedPrompts and kvCacheUsage candidate signals in Policies, allowing saturation thresholds to be tuned from real data.