Skip to content

Setting up Kong Observability stack (logs, metrics, traces) with Grafana

License

Notifications You must be signed in to change notification settings

liyangau/kong-observability-grafana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kong observability with Grafana

This repo demonstrate how to config Kong to ship logs, metrics and traces to different backend and use grafana as the dashboard to visulise the data.

The solution

Backend

  • Logs -> Loki
  • Metrics -> Prometheus
  • Traces -> Jaeger

App

Docker

Inside the docker/ folder, run docker compose up -d to start all containers.

  • Kong is running in dbless mode and kong config is kong.yaml.
  • Use Kong Gateway image and apply the license from environment variable KONG_LICENSE_DATA on host machine. If this is not set, Kong gateway image will run in free mode.
  • I disabled Grafana password. To enable password login, simply remove below environment variables from compose.yaml file.
        environment:
        - GF_AUTH_ANONYMOUS_ENABLED=true
        - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
        - GF_AUTH_DISABLE_LOGIN_FORM=true
  • All three datasources and two dashboard are pre-configured. If you change the service name on the compose file, please update the the files in grafana/ folder.

Kubernetes

Inside the kubernetes/ folder, run ./install.sh to deploy everything for you.

  • Kong is also running in dbless mode with Kong ingress controller with Gateway API enabled.
  • The script detects environment variable KONG_LICENSE_DATA and reates a KongLicence object accordingly.
  • I have to create clusterrole and clusterrolebinding for opentelemetry collector to scrape the Kong pod. If you have a better solution, please submit your PR.
  • Grafana dashboard password is also disabled. Please remove the env section of values.yaml if you need the log in page.

Detail explaination of the solution can be found on this blog post.

About

Setting up Kong Observability stack (logs, metrics, traces) with Grafana

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages