The gateway-api-state-metrics repository provides Kube State Metrics CustomResourceState configurations specifically designed for Gateway API resources. It enables operators to expose detailed metrics about Gateway API objects running in Kubernetes clusters, integrating with the standard Kube State Metrics framework to make Gateway API resource state observable through Prometheus and Grafana.
The repository's core offering is a CustomResourceState configuration file located at ./config/default/custom-resource-state.yaml that defines how Kube State Metrics should expose metrics for Gateway API resources including GatewayClasses, Gateways, HTTPRoutes, GRPCRoutes, TLSRoutes, TCPRoutes, and UDPRoutes. All metrics are prefixed with gatewayapi_ and include GVK labels for precise filtering and matching, along with name and namespace labels where applicable. The complete metric list is documented in METRICS.md.
For ease of deployment, the repository includes a kustomization.yaml file that generates a ConfigMap containing the CustomResourceState configuration, simplifying integration with existing Kubernetes deployments. An example integration with kube-prometheus is provided in ./config/examples/kube-prometheus, which demonstrates how to mount the ConfigMap as a volume in the kube-state-metrics Deployment, add the necessary command-line arguments, patch RBAC permissions for Gateway API resources, and update the kube-state-metrics image to a compatible version.
The repository includes a comprehensive set of Grafana dashboards available both locally in ./config/examples/dashboards and on grafana.com. These dashboards are organized by resource type with filtering variables and drill-down links that allow navigation from GatewayClasses to Gateways to individual routes. The dashboards cover all seven Gateway API resource types with dedicated visualizations for each.
Example Prometheus alert rules are provided in ./config/examples/rules, allowing operators to define alerting conditions based on Gateway API resource state metrics. Dashboards are written in jsonnet using the grafonnet library, with a make generate-dashboards command available to compile jsonnet source files into dashboard JSON. The repository includes development guidelines for grafonnet work, emphasizing experimentation, using Grafana's UI as a reference, and applying abstraction principles to avoid code repetition.
According to GitGenius activity tracking, the repository shows a median issue and pull request response latency of 93 hours across tracked items, though some items show significantly longer resolution times with a mean of 4693 hours. The most active contributors tracked are david-martin with 7 events, cello86 with 4 events, and KevFan with 2 events. Issue activity has focused on bugs, enhancements, and good first issue items. The repository shares contributors with related Kuadrant projects including mcp-gateway, kuadrant-operator, and authorino, indicating active collaboration within the broader Kuadrant ecosystem for API gateway and service mesh observability.