no dashboard?
How to use grafana to show it, no dashboard?
Hi, we have grafana dashboards in this repository https://github.com/percona/grafana-dashboards
for what it's worth, you can make use of the dashboards like so:
repo_path=${HOME}/git/percona/grafana-dashboards
git clone https://github.com/percona/grafana-dashboards.git ${repo_path}
for dashboard in ${repo_path}/dashboards/MongoDB/*.json; do
python2 ${repo_path}/misc/convert-dash-from-PMM.py ${dashboard}
done
then just manually import each dashboard from ${repo_path}/dashboards/MongoDB/*.json using your grafana dashboard importer.
to install the plugins used by the dashboards, run the following on your grafana server (assuming you are running grafana from systemd with a unit file named grafana-server.service which runs the server under a service account named grafana):
grafana_user=grafana
grafana_service=grafana-server.service
sudo -u ${grafana_user} grafana-cli plugins install grafana-polystat-panel
sudo -u ${grafana_user} grafana-cli plugins install natel-discrete-panel
sudo -u ${grafana_user} grafana-cli plugins install yesoreyeram-boomtable-panel
sudo systemctl restart ${grafana_service}
you can even preview the dashboards:
- MongoDB Cluster Summary
- MongoDB InMemory Details
- MongoDB Instance Summary
- MongoDB Instances Compare
- MongoDB Instances Overview
- MongoDB MMAPv1 Details
- MongoDB ReplSet Summary
- MongoDB WiredTiger Details
finally, the dashboards are not as up to date as the exporter and rely on deprecated metrics names. you can work around this by running your exporter in compatibility mode. eg:
[Unit]
Description=prometheus mongodb exporter
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/mongodb_exporter \
--mongodb.uri=mongodb://${username}:${password}@${fqdn}:27017/?tls=true&replicaSet=rs0&authSource=admin \
--collect-all \
--compatible-mode
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
I've also found this dashboard working great with Percona exporter https://grafana.com/grafana/dashboards/16490-opstree-mongodb-dashboard/
Guys, it's not clear for me how to set the Cluster variable in dashboards. Can someone clarify that? I want somehow distinguish clusters at the one dashboard.