New announcements for Serverless, Network, RUM, and more from Dash! New announcements from Dash!

Kong

Agent Check Agent Check

Supported OS: Linux Mac OS Windows

Overview

The Agent’s Kong check tracks total requests, response codes, client connections, and more.

Setup

Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the Autodiscovery Integration Templates for guidance on applying these instructions.

Installation

The Kong check is included in the Datadog Agent package, so you don’t need to install anything else on your Kong servers.

Configuration

Edit the kong.d/conf.yaml file, in the conf.d/ folder at the root of your Agent’s configuration directory.

Metric collection

  1. Add this configuration block to your kong.d/conf.yaml file to start gathering your Kong Metrics:

      init_config:
    
      instances:
        # Each instance needs a `kong_status_url`. Tags are optional.
        - kong_status_url: http://example.com:8001/status/
          tags:
            - instance:foo
        - kong_status_url: http://example2.com:8001/status/
          tags:
            - instance:bar

    See the sample kong.d/conf.yaml for all available configuration options.

  2. Restart the Agent.

Log collection

Available for Agent >6.0

Kong access logs are generated by NGINX, so the default location is the same as for NGINX files.

  1. Collecting logs is disabled by default in the Datadog Agent, enable it in your datadog.yaml file:

      logs_enabled: true
  2. Add this configuration block to your kong.d/conf.yaml file to start collecting your Kong Logs:

      logs:
        - type: file
          path: /var/log/nginx/access.log
          service: <SERVICE>
          source: kong
    
        - type: file
          path: /var/log/nginx/error.log
          service: <SERVICE>
          source: kong
    

    Change the path and service parameter values and configure them for your environment. See the sample kong.d/conf.yaml for all available configuration options.

  3. Restart the Agent.

Validation

Run the Agent’s status subcommand and look for kong under the Checks section.

Data Collected

Metrics

kong.table.count
(gauge)
Total number of tables in the database.
Shown as table
kong.table.items
(gauge)
Number of items in each table of the database.
Shown as row
kong.connections_accepted
(gauge)
Total number of accepted client connections.
Shown as connection
kong.connections_active
(gauge)
Current number of active client connections including Waiting connections.
Shown as connection
kong.connections_handled
(gauge)
Total number of handled connections. (Same as accepts unless resource limits were reached).
Shown as connection
kong.connections_reading
(gauge)
Current number of connections where Kong is reading the request header.
Shown as connection
kong.connections_waiting
(gauge)
Current number of idle client connections waiting for a request.
Shown as connection
kong.connections_writing
(gauge)
Current number of connections where nginx is writing the response back to the client.
Shown as connection
kong.total_requests
(gauge)
Total number of client requests.
Shown as request

Events

The Kong check does not include any events.

Service Checks

kong.can_connect:
Returns CRITICAL if the Agent cannot connect to Kong to collect metrics, otherwise returns OK.

Troubleshooting

Need help? Contact Datadog support.

Further Reading


Mistake in the docs? Feel free to contribute!