Skip to content

Metrics reference

All metrics use the gatewai_ prefix (gateway) or gatewai_relay_ prefix (relay). See Prometheus for setup instructions.

MetricTypeLabelsDescription
gatewai_requests_totalcountermode, service_type, model, statusTotal requests handled by the gateway
gatewai_request_duration_secondshistogrammode, service_type, modelEnd-to-end request duration. Buckets: 0.1s–300s
gatewai_model_hidden_totalcounterservice_type, modelRequests rejected (404) because the model is gated by services[].visibility and the caller is outside its audience
MetricTypeLabelsDescription
gatewai_async_jobs_submitted_totalcounterservice_type, modelJobs accepted (HTTP 202)
gatewai_async_jobs_cancelled_totalcounterservice_type, modelJobs cancelled by client (DELETE /jobs/{type}/{id})
gatewai_async_jobs_cancelled_while_processing_totalcounterservice_type, modelJobs cancelled while relay was processing them
gatewai_async_jobs_purged_totalcountermodelJobs deleted via admin purge endpoint
gatewai_async_stale_jobs_swept_totalcountermodelPending jobs marked failed by the stale-job GC
gatewai_async_jobs_reaped_totalcountermodel, outcome (requeued|deadletter|dropped)Orphaned processing jobs handled by the GC phase-0 lease reaper
gatewai_jobs_totalcounterservice_type, model, status (completed|failed)Async jobs reaching a terminal outcome, incremented once on the gateway side (not the relay) so it stays reliable regardless of relay deployment shape
gatewai_idempotency_requests_totalcounterservice_type, outcome (created|replayed|conflict)Async submissions carrying an Idempotency-Key, by outcome
gatewai_jobs_by_consumer_totalcountermode, service_type, model, consumerJobs submitted per consumer. Requires metricsConfig.consumerLabels: true
gatewai_webhook_deliveries_totalcounterresult (delivered|deadletter)Terminal webhook outcomes
gatewai_webhook_retry_queue_depthgauge—Webhooks currently scheduled for retry in Redis
gatewai_relay_queue_depthgaugemodel, state (pending|processing)Live length of each relay queue list, read from Redis on every scrape
gatewai_relay_queue_orphans_swept_totalcountermodel, state (pending|processing)Relay queue entries removed by GC phase 3 because their job record no longer exists
MetricTypeLabelsDescription
gatewai_ratelimit_requests_totalcounterservice_type, user_type, resultRequests evaluated by rate limiter (result: allowed|rejected)
gatewai_ratelimit_consumer_hits_totalcounterservice_type, user_type, consumerPer-consumer rate-limit evaluations (use with group() for distinct count)
gatewai_ratelimit_errors_totalcounterservice_typeRedis errors during rate-limit checks (requests allowed on error)
gatewai_token_ratelimit_checked_totalcounterservice_type, user_type, resultToken budget checks (result: allowed|rejected)
gatewai_token_ratelimit_errors_totalcounterservice_typeRedis errors during token budget checks
gatewai_concurrent_job_checks_totalcounterservice_type, user_type, resultConcurrent job limit checks
gatewai_processingtime_checks_totalcounterservice_type, user_type, resultProcessing time budget checks
gatewai_quota_resets_totalcounterservice_typePer-consumer quota resets performed via the admin quota-reset endpoint
MetricTypeLabelsDescription
gatewai_llm_requests_totalcounterservice_type, model, backend_model, provider, user_type, status, streamLLM requests by provider, HTTP status, and whether the request was streamed (stream: true|false)
gatewai_llm_tokens_totalcounterservice_type, model, backend_model, user_type, typeTokens served (type: prompt|completion), includes cache hits
gatewai_llm_request_duration_secondshistogramservice_type, model, backend_model, provider, user_type, streamEnd-to-end LLM request latency. Buckets: 0.05s–120s
gatewai_llm_time_to_first_token_secondshistogramservice_type, model, backend_model, provider, user_typeStreaming only: delay from the gateway writing SSE headers to the first chunk received from the backend. Buckets: 0.01s–30s
gatewai_llm_tokens_per_requesthistogramservice_type, model, backend_model, user_typeTotal tokens (prompt+completion) per request. Buckets: 50–100 000
gatewai_llm_consumer_tokens_topgaugeconsumer, user_type, typeToken usage for top-N consumers (refreshed from Redis every 60s). Requires metricsConfig.topConsumers > 0
gatewai_llm_fallback_totalcounterservice_type, model, fallbackRequests re-routed to services[].fallback_model because the primary model’s backends were all circuit-open
gatewai_backend_circuit_opengaugemodel, backend1 while an LLM backend’s circuit breaker is open (skipped), 0 when closed
gatewai_backend_circuit_opens_totalcountermodel, backendNumber of times a backend’s circuit transitioned to open
gatewai_backend_circuit_skipped_totalcountermodel, backendRequests that skipped a backend because its circuit was open
MetricTypeLabelsDescription
gatewai_usage_tokens_topgaugeconsumer, service_type, token_type, user_typeToken usage for top-N consumers on non-LLM-proxy services (refreshed from Redis every 60s). user_type is the consumer’s last-known rate-limit tier for that service, empty if never recorded. Requires metricsConfig.topConsumers > 0
gatewai_usage_requests_topgaugeconsumer, service_type, user_typeRequest count for top-N consumers per service type, sync and async alike (refreshed from Redis every 60s). Requires metricsConfig.topConsumers > 0
gatewai_usage_processing_time_topgaugeconsumer, service_type, user_typeCumulative processing time (seconds) for top-N consumers per service type (refreshed from Redis every 60s). Requires metricsConfig.topConsumers > 0
MetricTypeLabelsDescription
gatewai_cache_hits_totalcounterservice_type, modelLLM response cache hits
gatewai_cache_misses_totalcounterservice_type, modelLLM response cache misses
gatewai_cache_errors_totalcounterservice_type, model, operationLLM response cache errors
MetricTypeLabelsDescription
gatewai_guardrails_pii_blocked_totalcounterservice_type, modelRequests blocked by PII guardrail
gatewai_guardrails_evaluations_totalcounterservice_type, model, stage (input|output)Every guardrails-enabled evaluation, regardless of outcome — the denominator for a hit rate against gatewai_guardrails_total
gatewai_guardrails_async_totalcounterservice_type, model, detector, result (flagged|blocked|redacted|error)Result-stage guardrail detections on async job results
gatewai_guardrails_model_detections_totalcounterservice_type, model, stage, detector, mode (sync|async), result (blocked|flagged)Detections from a model-backed guardrail detector
gatewai_guardrails_model_latency_secondshistogramdetectorLatency of a model-backed guardrail detector call. Buckets: 10ms–5s
gatewai_guardrails_model_errors_totalcounterdetector, reason (timeout|unreachable|bad_response)Model-backed guardrail detector call failures
gatewai_guardrails_model_cache_totalcounterdetector, result (hit|miss)Model-backed guardrail verdict-cache lookups
gatewai_guardrails_model_skipped_totalcounterdetector, reasonModel-backed guardrail calls skipped by a guard (e.g. the input-length gate)
MetricTypeLabelsDescription
gatewai_auth_oauth2_duration_secondshistogramoperation (jwt|introspection)OAuth2 token verification latency. Buckets: 1ms–2.5s
gatewai_auth_oauth2_errors_totalcounteroperation, reason (invalid_token|unreachable)OAuth2 token verification failures
MetricTypeLabelsDescription
gatewai_authz_decisions_totalcounterservice_type, model, decision (allow|deny)Authorization decisions evaluated against policies.rules
MetricTypeLabelsDescription
gatewai_s3_errors_totalcounteroperationS3 operation errors
gatewai_s3_operation_duration_secondshistogramoperationS3 operation duration. Default Prometheus buckets
gatewai_redis_errors_totalcounteroperationRedis operation errors
gatewai_redis_operation_duration_secondshistogramoperationRedis operation duration. Default Prometheus buckets

MetricTypeLabelsDescription
gatewai_relay_jobs_totalcounterservice_type, statusJobs processed by the relay (status: success|failed)
gatewai_relay_inference_duration_secondshistogramservice_type, modelInference call duration. Buckets: 0.5s–600s
gatewai_relay_input_size_byteshistogramservice_typeInput file size. Exponential buckets: 1 KB–256 MB
gatewai_relay_s3_errors_totalcounteroperationRelay S3 operation errors
gatewai_relay_s3_operation_duration_secondshistogramoperationRelay S3 operation duration. Default Prometheus buckets
gatewai_relay_redis_publish_errors_totalcounter—Redis pub/sub publish errors on job completion
gatewai_relay_redis_done_errors_totalcounter—Redis errors when removing job from processing list