Monitoring API Gateway through Prometheus Metrics
How do I collect Prometheus metrics?
To check the usage of the application and system parameters, use the following metrics endpoint: GET /metrics. When the endpoint is called, API Gateway gathers metrics and returns the data in the Prometheus format.
Prometheus metrics are exposed through the following endpoint.
[http|https]://host:port/metrics
- Default primary port (http). 5555
- Default secure port (https). 5543
- Default diagnostic port (debug port). 9999
A sample for the metrics endpoint is as follows:
http://server:5555/metrics
The metrics you monitor have the following characteristics:
- The metrics are maintained separately for each cluster node
- The metrics are not persisted. They are reinitialized on API Gateway restart.
- By default, the authentication is disabled when running API Gateway as Docker container.
-
For on-premise installations, the following environment variable can be set to switch off the authentication for the metrics endpoint:
SAG_IS_METRICS_ENDPOINT_ACL=Anonymous
The endpoint also exposes the Integration Server Prometheus metrics. For more details on the Integration Server Prometheus metrics, see Developing Microservices with webMethods Microservices Runtime .
Exposing API Gateway Prometheus Metrics over a dedicated port
The metrics endpoint can be made available on a custom port. After creating the port, add the following service to the port's allow list:
wm.server.query:getPrometheusStats
Similarly, the metrics endpoint can be removed from the default ports (5555 or 5543 or 9999) by removing the service from the allow or deny lists.