Kong Gateway monitoring

To enable Kong Observability in Dynatrace, you have the following options.

  • recommended Enable OneAgent for Gateway logs, traces, and process monitoring. This should be combined with Dynatrace Prometheus scraping to monitor Kong Gateway metrics.
  • Monitor Kong using a combination of OpenTelemetry for traces and Prometheus for Kong Gateway metrics.

Metrics

Kong’s Prometheus plugin is a convenient way to collect Kong Gateway metrics. Dynatrace can collect these metrics directly from the Gateway produced by the Kong plugin. The default port and endpoint is 8001/metrics.

For more information and a list of available metrics, see the Kong Prometheus plugin documentation.

Step 1 Enable Kong Prometheus plugin

Basic configuration

To enable basic configuration of the Kong Prometheus plugin send a POST request replacing {HOST} with the host name value.

curl -s -X POST http://{HOST}:8001/plugins \
-H 'Content-Type: application/json' \
-d '{
"name": "prometheus"
}'

Additional plugin metrics

To enable additional metrics produced by the Kong Gateway Prometheus plugin, send a POST request replacing {HOST} and {PLUGIN-INSTANCE_NAME} with proper values:

curl -s -X POST http://{HOST}:8001/plugins \
-H 'Content-Type: application/json' \
-d '{
"name": "prometheus",
"instance_name": "{PLUGIN-INSTANCE_NAME}",
"config": {
"per_consumer": true,
"status_code_metrics": true,
"latency_metrics": true,
"bandwidth_metrics": true,
"upstream_health_metrics": true
}
}'

To check available Kong metrics, query the /metrics endpoint:

curl -i http://{HOST}:8001/metrics

Step 2 Collect Prometheus metrics

After configuring Kong Gateway's Prometheus plugin, metrics can be collected using the Dynatrace ActiveGate (recommended) or the OpenTelemetry Collector.