Skip to main content
Version: Next

Metrics

When metrics.provider: prometheus is configured, metrics are exposed at /metrics in Prometheus format and can be scraped by any compatible collector.

gateway:
server:
metrics:
enabled: true
provider: prometheus

Available Metrics


MetricTypeLabelsDescription
kono_requests_totalCounterroute, method, statusTotal incoming requests that reached a flow, labeled by final HTTP status
kono_requests_duration_secondsHistogramroute, methodEnd-to-end request latency from gateway entry to response write
kono_requests_in_flightGaugeCurrent number of requests being processed
kono_failed_requests_totalCounterreasonRequests rejected before reaching a flow (see reasons below)
kono_upstream_requests_totalCounterroute, upstreamTotal requests dispatched to each upstream
kono_upstream_errors_totalCounterroute, upstream, kindUpstream errors broken down by error kind
kono_upstream_latency_secondsHistogramroute, upstreamTime from upstream request dispatch to response received
kono_upstream_retries_totalCounterroute, upstreamNumber of retry attempts per upstream
kono_circuit_breaker_stateGaugeupstreamCircuit breaker state: 0=closed, 1=open, 2=half-open

Upstream Error Kinds


The kind label on kono_upstream_errors_total reflects the internal error classification:

KindDescription
timeoutUpstream did not respond within the configured timeout
connectionFailed to establish a connection to the upstream
bad_statusUpstream returned HTTP 5xx
read_errorConnection was closed while reading the response body
body_too_largeResponse body exceeded max_response_body_size
canceledRequest was canceled by the client
circuit_openRequest was rejected by an open circuit breaker (upstream not contacted)
policy_violationResponse violated upstream policy (allowed_statuses, require_body)

Failure Reasons


kono_failed_requests_total tracks requests that never reach a flow:

ReasonDescription
too_many_requestsRate limiter rejected the request
no_matched_flowNo flow matched the request path or method
body_too_largeRequest body exceeded the gateway body size limit (5MB)

Grafana


Connect Prometheus as a data source and use kono_* metrics to build dashboards. Recommended starting panels:

  • RPSrate(kono_requests_total[1m])
  • p99 latencyhistogram_quantile(0.99, rate(kono_requests_duration_seconds_bucket[5m]))
  • Upstream error raterate(kono_upstream_errors_total[1m])
  • Circuit breaker openkono_circuit_breaker_state == 1
  • Retry pressurerate(kono_upstream_retries_total[5m])
  • In-flight requestskono_requests_in_flight