Enable it once, globally, and scrape /metrics on port 8100. Per-service latency and status-code counters come for free.
curl -X POST http://localhost:8001/plugins \
--data name=prometheus \
--data config.status_code_metrics=true \
--data config.latency_metrics=true \
--data config.upstream_health_metrics=true
curl http://localhost:8100/metrics
kong_http_requests_total{service="billing",code="200"} 48210
kong_request_latency_ms_bucket{service="billing",le="100"} 47990
kong_upstream_target_health{upstream="billing-upstream",state="healthy"} 1
kong_nginx_connections_total{state="active"} 42
# Per-consumer metrics are off by default and are the ones that explode
# cardinality - one time series per consumer per service per status code.
Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.
Published 2026-08-25