Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

johnrichter/kong-datadog

Repository files navigation

Archived

This project is archived. Please see datadog-examples instead.

Kong | Datadog Example

This repo is an example of how to monitor Kong with Datadog. It depends on a few third party open source applications.

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.

Build and run

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 http:https://localhost:8001/plugins/ \
    --data "name=prometheus"
$ curl -X POST http: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 http:https://localhost:8001/services/ \
  --data 'name=example-service' \
  --data 'url=http:https://example_api:3333/api/pizzas'
$ curl -i -X POST \
  --url http:https://localhost:8001/services/example-service/routes \
  --data 'name=example-route'
  --data 'paths[]=/example'

If you prefer you can open Konga on http: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

About

An example of monitoring Kong with Datadog

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published