To enable gateway metrics, add spring-boot-starter-actuator as a project dependency. Then, by default, the gateway metrics filter runs as long as the property `spring.cloud.gateway.metrics.enabled` is not set to `false`. This filter adds a timer metric named `gateway.requests` with the following tags:
To enable gateway metrics, add spring-boot-starter-actuator as a project dependency.
Then, by default, the gateway metrics filter runs as long as the property `spring.cloud.gateway.metrics.enabled` is not set to `false`.
This filter adds a timer metric named `spring.cloud.gateway.requests` with the following tags:
* `routeId`: The route ID.
* `routeUri`: The URI to which the API is routed.
@ -1865,7 +1867,7 @@ To enable gateway metrics, add spring-boot-starter-actuator as a project depende
@@ -1865,7 +1867,7 @@ To enable gateway metrics, add spring-boot-starter-actuator as a project depende
* `httpStatusCode`: The HTTP Status of the request returned to the client.
* `httpMethod`: The HTTP method used for the request.
These metrics are then available to be scraped from `/actuator/metrics/gateway.requests` and can be easily integrated with Prometheus to create a link:images/gateway-grafana-dashboard.jpeg[Grafana] link:gateway-grafana-dashboard.json[dashboard].
These metrics are then available to be scraped from `/actuator/metrics/spring.cloud.gateway.requests` and can be easily integrated with Prometheus to create a link:images/gateway-grafana-dashboard.jpeg[Grafana] link:gateway-grafana-dashboard.json[dashboard].
NOTE: To enable the prometheus endpoint, add `micrometer-registry-prometheus` as a project dependency.
@ -71,7 +71,7 @@ public class GatewaySampleApplicationWithoutMetricsTests {
@@ -71,7 +71,7 @@ public class GatewaySampleApplicationWithoutMetricsTests {