Metadata-Version: 2.1
Name: datadog-kong
Version: 1.10.1
Summary: The Kong check
Home-page: https://github.com/DataDog/integrations-core
Author: Datadog
Author-email: packages@datadoghq.com
License: BSD
Keywords: datadog agent kong check
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Topic :: System :: Monitoring
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Description-Content-Type: text/markdown
Requires-Dist: datadog-checks-base (>=11.0.0)
Provides-Extra: deps

# Kong Integration

## Overview

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

## Setup

### Installation

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

### Configuration

#### Host

Follow the instructions below to configure this check for an Agent running on a host. For containerized environments, see the [Containerized](#containerized) section.

##### Metric collection

1. Add this configuration block to your `kong.d/conf.yaml` file in the `conf.d/` folder at the root of your [Agent's configuration directory][2] to start gathering your [Kong Metrics](#metrics). See the [sample kong.d/conf.yaml][3] for all available configuration options.

   ```yaml
   init_config:

   instances:
     ## @param kong_status_url - string - required
     ## URL where Kong exposes its status.
     #
     - kong_status_url: http://localhost:8001/status/
   ```

2. [Restart the Agent][4].

##### Log collection

_Available for Agent versions >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:

   ```yaml
   logs_enabled: true
   ```

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

   ```yaml
   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][2] for all available configuration options.

3. [Restart the Agent][4].

#### Containerized

For containerized environments, see the [Autodiscovery Integration Templates][5] for guidance on applying the parameters below.

##### Metric collection

| Parameter            | Value                                                 |
| -------------------- | ----------------------------------------------------- |
| `<INTEGRATION_NAME>` | `kong`                                                |
| `<INIT_CONFIG>`      | blank or `{}`                                         |
| `<INSTANCE_CONFIG>`  | `{"kong_status_url": "http://%%host%%:8001/status/"}` |

##### Log collection

_Available for Agent versions >6.0_

Collecting logs is disabled by default in the Datadog Agent. To enable it, see [Kubernetes log collection documentation][6].

| Parameter      | Value                                             |
| -------------- | ------------------------------------------------- |
| `<LOG_CONFIG>` | `{"source": "kong", "service": "<SERVICE_NAME>"}` |

### Validation

[Run the Agent's status subcommand][7] and look for `kong` under the Checks section.

## Data Collected

### Metrics

See [metadata.csv][8] for a list of metrics provided by this integration.

### Events

The Kong check does not include any events.

### Service Checks

**kong.can_connect**:<br>
Returns `CRITICAL` if the Agent cannot connect to Kong to collect metrics, otherwise returns `OK`.

## Troubleshooting

Need help? Contact [Datadog support][9].

## Further Reading

- [Monitor Kong with our new Datadog integration][10]

[1]: https://app.datadoghq.com/account/settings#agent
[2]: https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-configuration-directory
[3]: https://github.com/DataDog/integrations-core/blob/master/kong/datadog_checks/kong/data/conf.yaml.example
[4]: https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent
[5]: https://docs.datadoghq.com/agent/kubernetes/integrations/
[6]: https://docs.datadoghq.com/agent/kubernetes/log/
[7]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information
[8]: https://github.com/DataDog/integrations-core/blob/master/kong/metadata.csv
[9]: https://docs.datadoghq.com/help/
[10]: https://www.datadoghq.com/blog/monitor-kong-datadog


