Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for KrakenD Monitoring with Grafana
Ahmet Can Aydemir
Ahmet Can Aydemir

Posted on • Edited on • Originally published atahmetcanaydemir.com

     

KrakenD Monitoring with Grafana

KrakenD is an ultra-performant open-source Gateway that can transform, aggregate, or remove data from multiple services, with linear scalability.

I will explain how to monitor the status of KrakenD services with the Grafana dashboard.

KrakenD Grafana Dashboard

Instead of creating a dashboard from scratch, we can use one of the pre-configured dashboards available on grafana.com. In this article, we will use the KrakenD dashboard with ID 5722, prepared bydlopez. If you want, you can customize the dashboard according to your needs.

By default, this dashboard provides us with the following metrics:

  • Requests from users to KrakenD
  • Requests from KrakenD to your backends
  • Response times
  • Memory usage and details
  • Endpoints and status codes
  • Heatmaps
  • Open connections
  • Throughput
  • Distributions, timers, garbage collection, etc.

Prerequisites

  • KrakenD

InfluxDB Setup

The dashboard we will use uses InfluxDB to read metric data. You can easily run InfluxDB with Docker.

docker run-p 8086:8086\-eINFLUXDB_DB=krakend\-eINFLUXDB_USER=myusername-eINFLUXDB_USER_PASSWORD=mypassword\-eINFLUXDB_ADMIN_USER=admin-eINFLUXDB_ADMIN_PASSWORD=myadminpassword\-d--name=influx-1.8\  influxdb:1.8
Enter fullscreen modeExit fullscreen mode
dockerexec-it influx-1.8 /bin/bash
Enter fullscreen modeExit fullscreen mode

Grafana Setup

If Grafana is not installed, you run it with Docker. After the following command, Grafana will be running athttp://localhost:3000.

docker run\-d\-p 3000:3000\--name=grafana\  grafana/grafana
Enter fullscreen modeExit fullscreen mode

KrakenD Configuration

Add the following configuration to your krakend.json at the root level. After this, your KrakenD metrics will start saving to InfluxDB at<your-influx-db-server-ip>:8086.

{"version":2,"extra_config":{"github_com/letgoapp/krakend-influx":{"address":"http://<your-influx-db-server-ip>:8086","ttl":"25s","buffer_size":0},"github_com/devopsfaith/krakend-metrics":{"collection_time":"30s","listen_address":"127.0.0.1:8090"}}}
Enter fullscreen modeExit fullscreen mode

Importing the Grafana Dashboard

  1. Go to the browser and openhttp://localhost:3000. Useadmin for both username and password

  2. ClickConfiguration from the side menu and find the button to add the data source. Select InfluxDB as the database and fill in the details you provided when starting InfluxDB:

  • Query Language:InfluxQL
  • URL:http://localhost:8086
  • Access:Browser
  • Database:krakend
  • User:admin
  • Password:myadminpassword
  • HTTP Method:GET
  1. To import the dashboard: Click the+ icon in the side menu from the Grafana interface and then clickImport. SelectImport via Grafana.com. Enter5722 as the ID and clickLoad. Your dashboard is ready, enjoy it.

References

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

  • Location
    Istanbul, Turkey
  • Education
    Konya Technical University
  • Work
    Hepsiburada
  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp