Kong Gateway monitoring
With Dynatrace you can get observability for Kong Gateway and its managed APIs. Learn how to trace your Kong Gateway and collect metrics using the Kong Prometheus extension.
Prerequisites
-
Your Kong Gateway version is on 2.1+
-
OneAgent or Dynatrace Operator is installed and available for monitoring your Kong Gateway.
The required installation depends on your application:
If your application is running See the instruction for on a virtual machine or bare-metal OneAgent as workload in Kubernetes or OpenShift Dynatrace Operator
Traces
To get started with tracing of Kong applications, see Manual runtime instrumentation of NGINX.
Metrics
Dynatrace can collect metrics using the Kong Prometheus plugin. Thereby, the following configuration is assumed:
Setting | Details |
---|---|
Kong Services Endpoint |
|
Kong Routes Endpoint |
|
Kong Plugins Endpoint |
|
Prometheus Metrics Endpoint |
|
Kong Proxy HTTP Port |
|
Kong Proxy HTTPS Port |
|
Kong Admin HTTP Port |
|
Kong Admin HTTPS Port |
|
Make sure to adapt the installation instructions to your actual configuration.
Enable Prometheus plugin on Kong
To enable the Prometheus plugin on Kong, send the following POST request to the /plugins
endpoint:
1curl -X POST http://{HOST}:8001/plugins --data "name=prometheus"
Replace {HOST}
with the your actual value.
To check available Kong metrics, query the /metrics
endpoint:
1curl -i http://localhost:8001/metrics
Collect Prometheus metrics
The Prometheus plugin is the most convenient way to collect Kong metrics. The plugin is under continuous development, so more and more new metrics are coming.
Dynatrace currently provides three approaches for collecting Prometheus metrics, depending on the environment.
Kong metrics
Metric key | Description | Type |
---|---|---|
| Total bandwidth in bytes consumed per service/route in Kong | counter |
| Datastore reachable from Kong; 0 is unreachable | gauge |
| HTTP status codes per service/route in Kong | counter |
| Allocated slabs in bytes in a shared_dict | gauge |
| Total capacity in bytes of a shared_dict | gauge |
| Allocated bytes in worker Lua VM | gauge |
| Number of HTTP connections | gauge |
| Number of nginx-lua-prometheus errors | counter |
| Number of NGINX timers | gauge |