mongodb_exporter icon indicating copy to clipboard operation
mongodb_exporter copied to clipboard

no dashboard?

Open z3473 opened this issue 3 years ago • 4 comments

How to use grafana to show it, no dashboard?

z3473 avatar Mar 29 '23 07:03 z3473

Hi, we have grafana dashboards in this repository https://github.com/percona/grafana-dashboards

BupycHuk avatar Mar 29 '23 11:03 BupycHuk

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:

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

grenade avatar May 09 '23 07:05 grenade

I've also found this dashboard working great with Percona exporter https://grafana.com/grafana/dashboards/16490-opstree-mongodb-dashboard/

yod527 avatar Jul 03 '23 15:07 yod527

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.

gesundes avatar Jul 25 '23 11:07 gesundes