Add metric to track gateway route definition count (#2421)

* Add metric to track gateway route definition count

* Clean up documentation
This commit is contained in:
Fredrich Ombico
2021-10-28 16:02:00 -04:00
committed by GitHub
parent 03867f4ae9
commit 1c7c05e9bd
5 changed files with 212 additions and 0 deletions

View File

@@ -2073,6 +2073,10 @@ spring:
For some usages of the gateway, properties are adequate, but some production use cases benefit from loading configuration from an external source, such as a database. Future milestone versions will have `RouteDefinitionLocator` implementations based off of Spring Data Repositories, such as Redis, MongoDB, and Cassandra.
=== RouteDefinition Metrics
To enable `RouteDefinition` metrics, add spring-boot-starter-actuator as a project dependency. Then, by default, the metrics will be available as long as the property `spring.cloud.gateway.metrics.enabled` is set to `true`. A gauge metric named `spring.cloud.gateway.routes.count` will be added, whose value is the number of `RouteDefinitions`. This metric will be available from `/actuator/metrics/spring.cloud.gateway.routes.count`.
== Route Metadata Configuration
You can configure additional parameters for each route by using metadata, as follows: