Grafana Plugin Installation in Percona Monitoring and Management 2.x

grafana plugin installation PMM

Percona Monitoring and Management (PMM) is an open-source platform for monitoring databases and servers, that can be installed in your infrastructure and start collecting metrics from pmm-clients. Data is visualized in Grafana, which is the leading graph and dashboard builder tool. You can even improve it by adding additional third-party panels and plugins. More than a hundred of them are already presented on the official site.

We have already published a post about adding Grafana plugins to Percona Monitoring and Management 1.x versions. In this post, I want to provide information about Grafana Plugin installation in PMM 2.x versions.

Here is a list of some useful preinstalled Grafana plugins in PMM 2.x, with links to project sites:

Installing Grafana Plugins

First, browse to the list of available plugins and find a required one.
Let’s pick a clock panel. The next step is just clicking on the icon which sends you to the installation tab. Here you may copy an installation CLI command or jump to a project site in the cases of using a complicated method of installation. We will get back to this method further.

In general, new panels can be added by using grafana-cli command.

$ grafana-cli plugins install <plugin-name>

Here is a full command of an example of adding grafana clock panel into a docker container.

$ docker exec -it pmm-server grafana-cli plugins install grafana-clock-panel
installing grafana-clock-panel @ 1.0.3
from: https://grafana.com/api/plugins/grafana-clock-panel/versions/1.0.3/download
into: /var/lib/grafana/plugins

✔ Installed grafana-clock-panel successfully 

Restart grafana after installing plugins . <service grafana-server restart>

In addition to the above, plugins can be installed by downloading and uncompressing a .zip file of the plugin into the Grafana plugins folder (/var/lib/grafana/plugins/). We are using this method in PMM 2.x in order to provide only plugins that are tested and compatible with a used Grafana version. Also, this method can be used if your server has no access to the internet.

A plugin file can be taken from a project site.

Here are the commands of adding the same panel.

$ docker cp grafana-clock-panel-v1.0.3-0-gbb466d0.zip pmm-server:/tmp
$ docker exec -t pmm-server bash -c "unzip /tmp/grafana-clock-panel-v1.0.3-0-gbb466d0.zip -d /var/lib/grafana/plugins/"
Archive:  /tmp/grafana-clock-panel-v1.0.3-0-gbb466d0.zip
bb466d0682d58af659b018748d53c0d3b69a8377
   creating: /var/lib/grafana/plugins/grafana-clock-panel-bb466d0/
...
$ docker exec -t pmm-server bash -c "grafana-cli plugins ls | grep clock"
grafana-clock-panel @ 1.0.3
$ docker exec -t pmm-server supervisorctl restart grafana
grafana: stopped
grafana: started
$

It’s worth mentioning that this method leads to an issue with the plugin updating process by grafana-cli command. So the updating procedure has to be followed by removing an existing plugin folder and copying a file with a new version.

Updating Grafana Plugins

Plugins are not updated automatically, however, you will be notified when updates are available, right within your Grafana. So you have to update plugins via a grafana-cli command.

In the next example, we are updating the clickhouse datasource plugin.

$ docker exec -t pmm-server-test bash -c "grafana-cli plugins update vertamedia-clickhouse-datasource""
Removing plugin: vertamedia-clickhouse-datasource
installing vertamedia-clickhouse-datasource @ 1.9.5
from: https://grafana.com/api/plugins/vertamedia-clickhouse-datasource/versions/1.9.5/download
into: /var/lib/grafana/plugins

✔ Installed vertamedia-clickhouse-datasource successfully
Restart grafana after installing plugins . <service grafana-server restart>
$ docker exec -t pmm-server supervisorctl restart grafana                 
grafana: stopped 
grafana: started 
$

We are keeping an eye on pre-installed plugins, and the latest versions of each are shipped with each PMM version.


by Vadim Yalovets via Percona Database Performance Blog

Comments