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:
Dynatrace can collect metrics using the Kong Prometheus plugin. Thereby, the following configuration is assumed:
Setting
Details
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.
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.
name:custom:com.dynatrace.extension.micrometer-quarkusversion:1.0.0minDynatraceVersion:"1.247"author:name:Dynatrace#dashboards:# - path: "dashboards/dashboard_exporter.json"#alerts:# - path: "alerts/alert_socket_usage.json"prometheus:-group:quarkusmetricsinterval:minutes:1featureSet:alldimensions:-key:quarkusvalue:const:quarkussubgroups:# global counters-subgroup:quarkusglobalcounterdimensions:-key:global_countersvalue:const:global_countersmetrics:# HELP process_uptime_seconds The uptime of the Java virtual machine# TYPE process_uptime_seconds gauge-key:com.dynatrace.process.global.uptime.secondsvalue:metric:process_uptime_secondstype:gaugefeatureSet: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.usagevalue:metric:process_cpu_usagetype:gaugefeatureSet: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.usagevalue:metric:system_cpu_usagetype:gaugefeatureSet: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.totalvalue:metric:jvm_classes_unloaded_classes_totaltype:countfeatureSet:global# HELP jvm_info_total JVM version info# TYPE jvm_info_total counter-key:com.dynatrace.jvm.global.info.totalvalue:metric:jvm_info_totaltype:countfeatureSet:global# HELP http_server_connections_seconds_max# TYPE http_server_connections_seconds_max gauge-key:com.dynatrace.http.server.connections.seconds.global.maxvalue:metric:http_server_connections_seconds_maxtype:gaugefeatureSet:global# HELP http_server_connections_seconds# TYPE http_server_connections_seconds summary-key:com.dynatrace.http.server.connections.seconds.active.global.countvalue:metric:http_server_connections_seconds_active_counttype:countfeatureSet:global-key:com.dynatrace.http.server.connections.seconds.active.global.duration.summaryvalue:metric:http_server_connections_seconds_duration_sumtype:gaugefeatureSet:global# HELP process_files_max_files The maximum file descriptor count# TYPE process_files_max_files gauge-key:com.dynatrace.process.files.global.maxvalue:metric:process_files_max_filestype:gaugefeatureSet:global# HELP http_server_bytes_written_max# TYPE http_server_bytes_written_max gauge-key:com.dynatrace.http.server.bytes.wrriten.global.maxvalue:metric:http_server_bytes_written_maxtype:gaugefeatureSet:global# HELP http_server_bytes_written# TYPE http_server_bytes_written summary-key:com.dynatrace.http.server.bytes.written.global.countvalue:metric:http_server_bytes_written_counttype:countfeatureSet:global-key:com.dynatrace.http.server.bytes.written.global.summaryvalue:metric:http_server_bytes_written_sumtype:gaugefeatureSet: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.lmvalue:metric:system_load_average_1mtype:gaugefeatureSet: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.percentvalue:metric:jvm_gc_overhead_percenttype:gaugefeatureSet: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.threadsvalue:metric:jvm_threads_daemon_threadstype:gaugefeatureSet: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.threadsvalue:metric:jvm_threads_live_threadstype:gaugefeatureSet:global# HELP http_server_requests_seconds# TYPE http_server_requests_seconds summary-key:com.dynatrace.http.server.bytes.written.global.countvalue:metric:http_server_requests_seconds_counttype:countfeatureSet:global-key:com.dynatrace.http.server.bytes.written.global.summaryvalue:metric:http_server_requests_seconds_sumtype:gaugefeatureSet:global# HELP http_server_requests_seconds_max# TYPE http_server_requests_seconds_max gauge-key:com.dynatrace.http.server.requests.seconds.maxvalue:metric:http_server_requests_seconds_maxtype:gaugefeatureSet: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.secondsvalue:metric:process_start_time_secondstype:gaugefeatureSet: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.maxvalue:metric:jvm_classes_loaded_classestype:gaugefeatureSet: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.threadsvalue:metric:jvm_threads_peak_threadstype:gaugefeatureSet: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.countervalue:metric:system_cpu_counttype:gaugefeatureSet:global# HELP process_files_open_files The open file descriptor count# TYPE process_files_open_files gauge-key:com.dynatrace.process.files.open.global.filesvalue:metric:process_files_open_filestype:gaugefeatureSet:global
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.