For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Control plane metrics
By default, the kgateway control plane exposes metrics in Prometheus format. You can use these metrics to monitor the health and performance of your gateway environment. For more information about how metrics are implemented, refer to the kgateway project developer docs.
View control plane metrics
The following steps show you how to quickly view the metrics endpoint of the control plane deployment. To integrate the metrics into your observability stack, see the OpenTelemetry guide.
-
Port-forward the control plane deployment on port 9092.
kubectl -n kgateway-system port-forward deployment/kgateway 9092 -
Open your browser to the metrics endpoint: http://localhost:9092/metrics.
Example output:
# HELP kgateway_controller_reconciliations_total Total controller reconciliations # TYPE kgateway_controller_reconciliations_total counter kgateway_controller_reconciliations_total{controller="gateway",result="success"} 1 kgateway_controller_reconciliations_total{controller="gatewayclass",result="success"} 2 kgateway_controller_reconciliations_total{controller="gatewayclass-provisioner",result="success"} 2
Control plane metrics reference
Review the following table to understand more about each metric.
Helpful terms:
-
Controller: A Kubernetes controller that reconciles resources as part of the kgateway control plane deployment.
-
Resource: A Kubernetes object that is managed by a controller of the control plane.
-
Snapshot: A complete, point-in-time representation of the current state of resources that the controller builds and serves to a gateway proxy via the Envoy extensible Discovery Service (XDS) API.
-
Sync: The metrics refer to two kinds of syncs:
- Status sync metrics represent the time it takes for you as a user to view the status that is reported on the resource.
- Snapshot sync metrics roughly represent the time it takes for a resource change to become effective in the gateway proxies.
-
Transform: The process of the control plane converting high-level resources or intermediate representations (IR) into lower-level representations into the structure that the XDS API expects for a snapshot.
| Name | Type | Labels | Help |
|---|---|---|---|
| kgateway_agentgateway_xds_rejects_total | counter | Total number of xDS responses rejected by agentgateway proxy | |
| kgateway_controller_reconcile_duration_seconds | histogram | controller, name, namespace | Reconcile duration for controller |
| kgateway_controller_reconciliations_running | gauge | controller, name, namespace | Number of reconciliations currently running |
| kgateway_controller_reconciliations_total | counter | controller, name, namespace, result | Total number of controller reconciliations |
| kgateway_envoy_xds_rejects_active | gauge | gateway_namespace, gateway_name, type_url | Number of xDS responses currently rejected by envoy proxy |
| kgateway_envoy_xds_rejects_total | counter | gateway_namespace, gateway_name, type_url | Total number of xDS responses rejected by envoy proxy |
| kgateway_resources_managed | gauge | namespace, parent, resource | Current number of resources managed |
| kgateway_resources_status_sync_duration_seconds | histogram | gateway, namespace, resource | Duration of time for a resource update to receive a status report |
| kgateway_resources_status_syncs_completed_total | counter | gateway, namespace, resource | Total number of status syncs completed for resources |
| kgateway_resources_status_syncs_started_total | counter | gateway, namespace, resource | Total number of status syncs started |
| kgateway_resources_updates_dropped_total | counter | Total number of resources metrics updates dropped. If this metric is ever greater than 0, all resources subsystem metrics should be considered invalid until process restart | |
| kgateway_routing_domains | gauge | namespace, gateway, port | Number of domains per listener |
| kgateway_status_syncer_status_sync_duration_seconds | histogram | name, namespace, syncer | Status sync duration |
| kgateway_status_syncer_status_syncs_total | counter | name, namespace, syncer, result | Total number of status syncs |
| kgateway_translator_translation_duration_seconds | histogram | name, namespace, translator | Translation duration |
| kgateway_translator_translations_running | gauge | name, namespace, translator | Current number of translations running |
| kgateway_translator_translations_total | counter | name, namespace, translator, result | Total number of translations |
| kgateway_xds_auth_rq_failure_total | counter | Total number of failed xDS auth requests | |
| kgateway_xds_auth_rq_success_total | counter | Total number of successful xDS auth requests | |
| kgateway_xds_auth_rq_total | counter | Total number of xDS auth requests | |
| kgateway_xds_snapshot_resources | gauge | gateway, namespace, resource | Current number of resources in XDS snapshot |
| kgateway_xds_snapshot_sync_duration_seconds | histogram | gateway, namespace | Duration of time for a gateway resource update to be synced in an XDS snapshot |
| kgateway_xds_snapshot_syncs_total | counter | gateway, namespace | Total number of XDS snapshot syncs |
| kgateway_xds_snapshot_transform_duration_seconds | histogram | gateway, namespace | XDS snapshot transform duration |
| kgateway_xds_snapshot_transforms_total | counter | gateway, namespace, result | Total number of XDS snapshot transforms |
Monitor NACKs
Monitor and troubleshoot Envoy proxy configuration rejections with control plane metrics.
About NACKs
A NACK (negative acknowledgement) occurs when an Envoy proxy rejects a configuration update from the kgateway control plane. NACKs typically indicate configuration issues that prevent the proxy from applying the desired routing, policy, or listener settings.
Typically, the kgateway control plane reports errors during translation, in which the control plane immediately rejects invalid configuration in custom resources and records errors in custom resource statuses. However, some errors can only be caught at configuration time, in which the control plane cannot determine the configuration failure until an Envoy proxy in the data plane rejects the configuration.
To track these NACKs, the kgateway control plane exposes Prometheus metrics that monitor the health of config synchronization between the control plane and Envoy proxies.
For more general information about kgateway control plane metrics, see Control plane metrics.
Common causes of NACKs include:
- Invalid Envoy configuration that passes control plane validation but is rejected by the Envoy proxy at runtime.
- Invalid TLS certificates.
You can access the kgateway control plane metrics endpoint to view NACK metrics that track configuration rejections from Envoy proxies.
View the NACK metrics
-
Port-forward the control plane deployment on port 9092.
kubectl -n kgateway-system port-forward deployment/kgateway 9092 -
Open the kgateway control plane metrics endpoint.
-
Search for the
kgateway_envoy_xds_rejects_totalandkgateway_envoy_xds_rejects_activemetrics.The metrics only appear after at least one NACK has been reported. If no NACKs have occurred, these metrics are not present in the metrics output.Example output:
# HELP kgateway_envoy_xds_rejects_total Total number of xDS responses rejected by envoy proxy # TYPE kgateway_envoy_xds_rejects_total counter kgateway_envoy_xds_rejects_total{gateway_namespace="default",gateway_name="gw",type_url="envoy.config.route.v3.RouteConfiguration"} 1 # HELP kgateway_envoy_xds_rejects_active Number of xDS responses currently rejected by envoy proxy # TYPE kgateway_envoy_xds_rejects_active gauge kgateway_envoy_xds_rejects_active{gateway_namespace="default",gateway_name="gw",type_url="envoy.config.route.v3.RouteConfiguration"} 0
Both metrics are labeled by gateway_namespace, gateway_name, and type_url. The type_url label identifies the Envoy resource type that was rejected, such as envoy.config.route.v3.RouteConfiguration.
| Metric | Type | Description |
|---|---|---|
kgateway_envoy_xds_rejects_total | Counter | The cumulative total number of xDS responses rejected by Envoy proxies. This value only increases over time. |
kgateway_envoy_xds_rejects_active | Gauge | The current number of active xDS rejections. This value increases when a new NACK occurs and decreases when the proxy successfully applies a subsequent configuration update (ACK). A value of 0 indicates no active rejections. |
You can use these metrics to configure alerts to notify you when NACKs occur so you can quickly investigate and resolve configuration issues.
For more information about how to set up the observability stack, see the OpenTelemetry stack guide.