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

Latest commit

 

History

History
59 lines (45 loc) · 2.34 KB

README.md

File metadata and controls

59 lines (45 loc) · 2.34 KB

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 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