Skip to content

PowerDNS/grafana-metronome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grafana integration with PowerDNS Metronome

This repository provides integration between the Grafana dashboard and PowerDNS Metronome, allowing you to graph Metronome datasources in Grafana. Pre-made dashboard configurations to monitor PowerDNS services are included (currently only for dnsdist, others coming soon).

Integration is implemented using a custom Metronome loader plugin for the Graphite-API server. This API server can be configured as a Graphite data source in Grafana to translate API requests to Metronome's REST API.

It provides a ready-to-run Docker Compose file to quickly get Grafana and the customized Graphite-API server up and running with a simple docker-compose up.

Quickstart using Docker

Prerequisites:

After cloning this repository, simply run:

$ docker-compose up

You can add the -d flag to start the services in te background.

You will now have Grafana running on http://localhost:13000/ with 'admin' as the default login and password.

After logging in as admin, click on the left-top menu > Data Sources > Add Data Source. Fill out the following fields:

  • Name: make sure to use 'metronome' to be able to use the shipped PowerDNS dashboard configurations. You might want to click 'default' to make it the default data source.
  • Type: graphite
  • Url: http://graphiteproxy (this hostname will be available within the Docker container)
  • Access: proxy
  • No authentication

If you go to your dashboards, your will find a few PowerDNS dashboards that display similar graphs as the default Metronome distribution (currently only for dnsdist, the ones for the recursor and authoritive server are coming soon).

You might want to check the Grafana Getting Started Guide on how to add new dashboards and customize the shipped ones.

Manual installation

If you want to setup Grafana and Graphite-API yourself without using Docker, you can follow the default documentation for both packages.

In order for Graphite-API to connect to Metronome servers, you need to copy the graphite-api/metronome/ Python package to your Python site-packages (cleaner method coming soon), and add the following to your Graphite-API configuration file:

finders:
  - metronome.MetronomeFinder
metronome:
  # URL of your Metronome instance,
  # or use the public PowerDNS hosted server for testing
  url: https://metrics.powerdns.com/metronome
  # How often to update the list of Metronome metrics (in seconds)
  metrics_cache_expiry: 300

Graphite-API must be run behind an nginx proxy, because its gunicorn sync workers do not handle clients that keep open connection well (crashing workers).

Under dashboards/ you will find a few special PowerDNS dashboards JSON files that will help you monitor PowerDNS services. You can either import them in Grafana, or add the directory as a JSON dashboard file loading location to the Grafana configuration. Customizing these is best done by editing dashboards/generate.py and running it.

Even if you are not using Docker, you might want to look at the following files for inspiration on how to configure your setup and run Graphite-API:

  • docker-compose.yml
  • grafana.ini
  • graphite-api/Dockerfile
  • graphite-api/graphite-api.yaml

Deploy with HTTP/2 for performance

The grafana web client performs many requests at the same time, one for each graph. Since browsers like Chrome limit the number of connections to one server to six, and fetching the data for one graph can take up to a few seconds, you end up with a staircase of requests in the network panel and very slow performance for large dashboards.

HTTP/2 allows multiplexing many requests over one TCP connection, which removes this connection limit issue. It will allow the frontend to send all requests at once to the server. It is therefore strongly recommended to setup a proxy that supports HTTP/2 in front of the grafana server.

Note that most browsers will only talk HTTP/2 to SSL (HTTPS) servers, so you need to get an SSL certificate for your domain name. Also, make sure your web server uses OpenSSL 1.0.2+ (Ubuntu 16.04+), otherwise HTTP/2 will not work on Chrome.

Resources:

Debugging

Metronome API requests:

Graphite-API requests:

TODO

  • Distribute the Graphite-API metronome loader plugin as a proper Python package.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published