Skip to content

Commit 31ea531

Browse files
authored
docs: Add user guide for Gateway API State Metrics (#1871)
1 parent 5cb8697 commit 31ea531

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Gateway API Metrics
2+
3+
Resource metrics for Gateway API objects are available using the [Gateway API State Metrics](https://github.com/Kuadrant/gateway-api-state-metrics) project.
4+
The project also provides example dashboard for visualising the metrics using Grafana, and example alerts using Prometheus & Alertmanager.
5+
6+
## Prerequisites
7+
8+
Follow the steps from the [Quickstart Guide](quickstart.md) to install Envoy Gateway and the example manifest.
9+
Before proceeding, you should be able to query the example backend using HTTP.
10+
11+
Run the following commands to install the metrics stack, with the Gateway API State Metrics configuration, on your kubernetes cluster:
12+
13+
```shell
14+
kubectl apply --server-side -f https://raw.githubusercontent.com/Kuadrant/gateway-api-state-metrics/main/config/examples/kube-prometheus/bundle_crd.yaml
15+
kubectl apply -f https://raw.githubusercontent.com/Kuadrant/gateway-api-state-metrics/main/config/examples/kube-prometheus/bundle.yaml
16+
```
17+
18+
## Metrics and Alerts
19+
20+
To access the Prometheus UI, wait for the statefulset to be ready, then use the port-forward command:
21+
22+
```shell
23+
# This first command may fail if the statefulset has not been created yet.
24+
# In that case, try again until you get a message like 'Waiting for 2 pods to be ready...'
25+
# or 'statefulset rolling update complete 2 pods...'
26+
kubectl -n monitoring rollout status --watch --timeout=5m statefulset/prometheus-k8s
27+
kubectl -n monitoring port-forward service/prometheus-k8s 9090:9090 > /dev/null &
28+
```
29+
30+
Navigate to [http://localhost:9090](http://localhost:9090).
31+
Metrics can be queried from the 'Graph' tab e.g. `gatewayapi_gateway_created`
32+
See the [Gateway API State Metrics README](https://github.com/Kuadrant/gateway-api-state-metrics/tree/main#metrics) for the full list of Gateway API metrics available.
33+
34+
Alerts can be see in the 'Alerts' tab.
35+
Gateway API specific alerts will be grouped under the 'gateway-api.rules' heading.
36+
37+
***Note:*** Alerts are defined in a PrometheusRules custom resource in the 'monitoring' namespace. You can modify the alert rules by updating this resource.
38+
39+
## Dashboards
40+
41+
To view the dashboards in Grafana, wait for the deployment to be ready, then use the port-forward command:
42+
43+
```shell
44+
kubectl -n monitoring wait --timeout=5m deployment/grafana --for=condition=Available
45+
kubectl -n monitoring port-forward service/grafana 3000:3000 > /dev/null &
46+
```
47+
48+
Navigate to [http://localhost:3000](http://localhost:3000) and sign in with admin/admin.
49+
The Gateway API State dashboards will be available in the 'Default' folder and tagged with 'gateway-api'.
50+
See the [Gateway API State Metrics README](https://github.com/Kuadrant/gateway-api-state-metrics/tree/main#dashboards) for further information on available dashboards.
51+
52+
***Note:*** Dashboards are loaded from configmaps. You can modify the dashboards in the Grafana UI, however you will need to export them from the UI and update the json in the configmaps to persist changes.

docs/latest/user_docs.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ Learn how to deploy, use, and operate Envoy Gateway.
3030
user/deployment-mode
3131
user/gateway-address
3232
user/gatewayapi-support
33+
user/gateway-api-metrics
3334
user/proxy-observability
3435
user/multicluster-service

0 commit comments

Comments
 (0)