Plugins 〉Consul


Developer

Stefan Bueringer

Sign up to receive occasional product news and updates:


Grafana Cloud
Grafana Cloud
  • Grafana, of course
  • 10k series Prometheus metrics
  • 50 GB logs
  • 50 GB traces
  • 2,232 app o11y host hours
  • ...and more
Create free account

No credit card needed, ever.


This plugin is no longer maintained. Consult the Grafana documentation and plugin catalog to discover potential alternatives.
Data Source
community

Consul

  • Overview
  • Installation
  • Related content

Grafana datasource for Consul

TravisCodecovCodeFactorGoReportCardGitHub release

contributions welcome

This datasource lets you integrate key value data from Consul in Grafana dashboards.

Overview

Usage

The data can be used in table and single-stat panels. The following explanations are based on the example available in the example folder.

Adding the datasource

  1. In the side menu in the Configuration section you should find a link named Data Sources.
  2. Click the Add data source button in the top header.
  3. Select Consul.
  4. Fill in the datasource name, the Consul address and the Consul token (or leave it empty)
  5. Click the Save & Test button

Features

  • Consul keys can be used as Dashboard variable values
  • Numeric Consul keys can be retrieved directly and displayed in Singlestat panels
  • Consul key/value pairs can be retrieved via Timeseries tags and displayed in Singlestat panels
  • Consul key/value pairs can be displayed in Table panels.

Examples

Variables

Variables

This example shows how keys can be queried to use them as variables. This query retrieves all direct subkeys of registry/apiregistration.k8s.io/apiservices/. The subkeys are then matched via the regex and can then be used as variable values.

Singlestat Panel

Tags

This example shows how subkeys can be retrieved as tags. These tags can then be displayed in the Single Stat panel by defining a legend format. Note: This only works if Value / Stat in the Option tab is set to Name.

Table Panel

Table

The final examples shows how key/value pairs can be displayed in tables. Every matching key of the query results in one row. Columns can then be retrieved relative from this key.

Installing Consul on Grafana Cloud:

For more information, visit the docs on plugin installation.

Installing on a local Grafana:

For local instances, plugins are installed and updated via a simple CLI command. Plugins are not updated automatically, however you will be notified when updates are available right within your Grafana.

1. Install the Data Source

Use the grafana-cli tool to install Consul from the commandline:

grafana-cli plugins install 

The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins. More information on the cli tool.

2. Configure the Data Source

Accessed from the Grafana main menu, newly installed data sources can be added immediately within the Data Sources section.

Next, click the Add data source button in the upper right. The data source will be available for selection in the Type select box.

To see a list of installed data sources, click the Plugins item in the main menu. Both core data sources and installed data sources will appear.