• Home
  • Deploy
  • Technology support
  • Runtimes
  • NGINX
  • Kong Gateway

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 runningSee the instruction for
    on a virtual machine or bare-metalOneAgent
    as workload in Kubernetes or OpenShiftDynatrace 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:

SettingDetails

Kong Services Endpoint

/services

Kong Routes Endpoint

/routes

Kong Plugins Endpoint

/plugins

Prometheus Metrics Endpoint

/metrics

Kong Proxy HTTP Port

8000

Kong Proxy HTTPS Port

8443

Kong Admin HTTP Port

8001

Kong Admin HTTPS Port

8444

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:

shell
curl -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:

shell
curl -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.

In Kubernetes, Dynatrace supports scraping of any HTTP(s) endpoint offering metrics in OpenMetrics format (for example, Prometheus exporters). Using Dynatrace-specific annotations, you can specify which pods or services to scrape.

  • Learn how to collect Prometheus metrics in Kubernetes.

Dynatrace provides a scalable means to ingest Prometheus metrics directly from the source, without Kubernetes. This works fully automatically and works best if OneAgent is installed on the box where the Prometheus metrics originate, but it can also be done in a fully agentless manner when OneAgent can't be installed on the box.

  • Learn how to collect Prometheus metrics without Kubernetes using Extensions 2.0 Prometheus data source.
  • Check our Extensions 2.0 tutorials.
Extension example based on Prometheus
yaml
name: custom:com.dynatrace.extension.micrometer-quarkus version: 1.0.0 minDynatraceVersion: "1.247" author: name: Dynatrace #dashboards: # - path: "dashboards/dashboard_exporter.json" #alerts: # - path: "alerts/alert_socket_usage.json" prometheus: - group: quarkus metrics interval: minutes: 1 featureSet: all dimensions: - key: quarkus value: const:quarkus subgroups: # global counters - subgroup: quarkus global counter dimensions: - key: global_counters value: const:global_counters metrics: # HELP process_uptime_seconds The uptime of the Java virtual machine # TYPE process_uptime_seconds gauge - key: com.dynatrace.process.global.uptime.seconds value: metric:process_uptime_seconds type: gauge featureSet: global # HELP process_cpu_usage The "recent cpu usage" for the Java Virtual Machine process # TYPE process_cpu_usage gauge - key: com.dynatrace.process.global.cpu.usage value: metric:process_cpu_usage type: gauge featureSet: global # HELP system_cpu_usage The "recent cpu usage" of the system the application is running in # TYPE system_cpu_usage gauge - key: com.dynatrace.system.global.cpu.usage value: metric:system_cpu_usage type: gauge featureSet: global # HELP jvm_classes_unloaded_classes_total The total number of classes unloaded since the Java virtual machine has started execution # TYPE jvm_classes_unloaded_classes_total counter - key: com.dynatrace.jvm.classes.global.uploaded.total value: metric:jvm_classes_unloaded_classes_total type: count featureSet: global # HELP jvm_info_total JVM version info # TYPE jvm_info_total counter - key: com.dynatrace.jvm.global.info.total value: metric:jvm_info_total type: count featureSet: global # HELP http_server_connections_seconds_max # TYPE http_server_connections_seconds_max gauge - key: com.dynatrace.http.server.connections.seconds.global.max value: metric:http_server_connections_seconds_max type: gauge featureSet: global # HELP http_server_connections_seconds # TYPE http_server_connections_seconds summary - key: com.dynatrace.http.server.connections.seconds.active.global.count value: metric:http_server_connections_seconds_active_count type: count featureSet: global - key: com.dynatrace.http.server.connections.seconds.active.global.duration.summary value: metric:http_server_connections_seconds_duration_sum type: gauge featureSet: global # HELP process_files_max_files The maximum file descriptor count # TYPE process_files_max_files gauge - key: com.dynatrace.process.files.global.max value: metric:process_files_max_files type: gauge featureSet: global # HELP http_server_bytes_written_max # TYPE http_server_bytes_written_max gauge - key: com.dynatrace.http.server.bytes.wrriten.global.max value: metric:http_server_bytes_written_max type: gauge featureSet: global # HELP http_server_bytes_written # TYPE http_server_bytes_written summary - key: com.dynatrace.http.server.bytes.written.global.count value: metric:http_server_bytes_written_count type: count featureSet: global - key: com.dynatrace.http.server.bytes.written.global.summary value: metric:http_server_bytes_written_sum type: gauge featureSet: global # HELP system_load_average_1m The sum of the number of runnable entities queued to available processors and the number of runnable entities running on the available processors averaged over a period of time # TYPE system_load_average_1m gauge - key: com.dynatrace.system.load.average.global.lm value: metric:system_load_average_1m type: gauge featureSet: global # HELP jvm_gc_overhead_percent An approximation of the percent of CPU time used by GC activities over the last lookback period or since monitoring began, whichever is shorter, in the range [0..1] # TYPE jvm_gc_overhead_percent gauge - key: com.dynatrace.jvm.gc.overhead.global.percent value: metric:jvm_gc_overhead_percent type: gauge featureSet: global # HELP jvm_threads_daemon_threads The current number of live daemon threads # TYPE jvm_threads_daemon_threads gauge - key: com.dynatrace.jvm.threads.daemon.global.threads value: metric:jvm_threads_daemon_threads type: gauge featureSet: global # HELP jvm_threads_live_threads The current number of live threads including both daemon and non-daemon threads # TYPE jvm_threads_live_threads gauge - key: com.dynatrace.jvm.threads.live.global.threads value: metric:jvm_threads_live_threads type: gauge featureSet: global # HELP http_server_requests_seconds # TYPE http_server_requests_seconds summary - key: com.dynatrace.http.server.bytes.written.global.count value: metric:http_server_requests_seconds_count type: count featureSet: global - key: com.dynatrace.http.server.bytes.written.global.summary value: metric:http_server_requests_seconds_sum type: gauge featureSet: global # HELP http_server_requests_seconds_max # TYPE http_server_requests_seconds_max gauge - key: com.dynatrace.http.server.requests.seconds.max value: metric:http_server_requests_seconds_max type: gauge featureSet: global # HELP process_start_time_seconds Start time of the process since unix epoch. # TYPE process_start_time_seconds gauge - key: com.dynatrace.process.start.time.global.seconds value: metric:process_start_time_seconds type: gauge featureSet: global # HELP jvm_classes_loaded_classes The number of classes that are currently loaded in the Java virtual machine # TYPE jvm_classes_loaded_classes gauge - key: com.dynatrace.jvm.classes.loaded.global.max value: metric:jvm_classes_loaded_classes type: gauge featureSet: global # HELP jvm_threads_peak_threads The peak live thread count since the Java virtual machine started or peak was reset # TYPE jvm_threads_peak_threads gauge - key: com.dynatrace.jvm.threads.peak.global.threads value: metric:jvm_threads_peak_threads type: gauge featureSet: global # HELP system_cpu_count The number of processors available to the Java virtual machine # TYPE system_cpu_count gauge - key: com.dynatrace.system.cpu.global.counter value: metric:system_cpu_count type: gauge featureSet: global # HELP process_files_open_files The open file descriptor count # TYPE process_files_open_files gauge - key: com.dynatrace.process.files.open.global.files value: metric:process_files_open_files type: gauge featureSet: global

Also, keep watching our Software intelligence hub, where we frequently publish new extensions.

Amazon provides a managed service for Prometheus, and Dynatrace provides the means to collect metrics directly from it if you need it. Typically, however, it would be more cost-effective to use one of the other methods described here and avoid the additional cost of the Amazon service.

  • Learn how to collect Prometheus metrics from Amazon Managed Service for Prometheus.

Kong metrics

Metric keyDescriptionType

kong_bandwidth

Total bandwidth in bytes consumed per service/route in Kong

counter

kong_datastore_reachable

Datastore reachable from Kong; 0 is unreachable

gauge

kong_http_status

HTTP status codes per service/route in Kong

counter

kong_memory_lua_shared_dict_bytes

Allocated slabs in bytes in a shared_dict

gauge

kong_memory_lua_shared_dict_total_bytes

Total capacity in bytes of a shared_dict

gauge

kong_memory_workers_lua_vms_bytes

Allocated bytes in worker Lua VM

gauge

kong_nginx_http_current_connections

Number of HTTP connections

gauge

kong_nginx_metric_errors_total

Number of nginx-lua-prometheus errors

counter

kong_nginx_timers

Number of NGINX timers

gauge

Related topics
  • Monitor Prometheus metrics

    Metric ingestion from Prometheus endpoints in Kubernetes, metrics alerts, and monitoring consumption.

  • Manage Prometheus extensions

    Learn how to extend observability in Dynatrace with declarative Prometheus metrics ingestion.

  • Prometheus configuration on Kong

    Official Kong documentation