This project is archived. Please see datadog-examples instead.
This repo is an example of how to monitor Kong with Datadog. It depends on a few third party open source applications.
- Konga: A lightweight UI built on top of Kong
- An example Nodejs API
The example runs entirely in Docker and leverages the offical Docker Compose template for Kong.
It leverages both Kong's built-in Datadog plugin that sends metrics to the Datadog Agent's Dogstatsd port and the Datadog Kong integration running within the Datadog Agent which collects metrics from the /status
and /metrics
Prometheus open metrics endpoints and logs from the Kong container.
Start Docker and then update the following env variables for the Datadog Agent container in docker-compose.yml
---
datadog:
environment:
DD_API_KEY: <your dd api key>
DD_ENV: <your env> # dev
DD_TAGS: <additional tags> # team:devops
$ git clone --recursive github.com:johnrichter/kong-datadog
$ ./init.sh
$ docker compose up
$ curl -X POST https://localhost:8001/plugins/ \
--data "name=prometheus"
$ curl -X POST https://localhost:8001/plugins/ \
--data "name=datadog" \
--data "config.host=datadog" \
--data "config.port=8125" \
--data "config.metrics=" \
--data "config.prefix=kong"
$ curl -i -X POST \
--url https://localhost:8001/services/ \
--data 'name=example-service' \
--data 'url=https://example_api:3333/api/pizzas'
$ curl -i -X POST \
--url https://localhost:8001/services/example-service/routes \
--data 'name=example-route'
--data 'paths[]=/example'
If you prefer you can open Konga on https://localhost:9000 to configure the service instead of leveraging the Kong Admin API.
Send in some traffic and then open Datadog to explore the kong.*
metrics, Kong Dashboards, and Kong logs.
$ for i in {1..100}; do curl -s localhost:8000/example/; done