Grafana dashboards for pgSCV

A week ago I made an announcement about pgSCV, a new metrics exporter for PostgreSQL. After the announcement, as expected, readers began to write to me with a hint that it would be nice to make dashboards. I have this task on my list and this request did not come as a surprise to me. It is understandable, metrics hoo how much and even advanced DBA will need a lot of time to understand them and to build a more or less sane dashboards.





I tackled the issue and made basic dashboards that cover a certain (but not all) volume of metrics that are in pgSCV. And in this post I will do a quick overview and tell you what is there.





I would like to emphasize that these are the initial versions and 146% that they will be supplemented and changed. There are several dashboards, tk. pgSCV is able to return metrics not only about Postgres, but also about Pgbouncer and even system metrics. With the development of pgSCV, it is planned to add support for other near-Postgres tools, so the list of dashboards will also be updated.





As the title suggests, the dashboards are made for Grafana. I am quite familiar with it and in my opinion it is a fairly widespread tool for visualizing metrics. All dashboards use Prometheus datasource. To be honest, dashboards were made on top of Victoriametrics storage, but I tried to use PromQL everywhere in queries, which affected the quality of some graphs. If suddenly the stars converge and the dashboards become rich and famous I will make them similar to MetricsQL.





There are three dashboards so far:





  • PostgreSQL metrics





  • Pgbouncer metrics





  • System metrics





What's in PostgreSQL

Overview - RED - requests, errors, durations - , . .





Activity - . Postgres.





Logs - Postgres. .





Statements - topN pg_stat_statements. , DBA.





Graphs of logs and requests.
.

Locks and Wait Events - wait events . .





Locks and Waits.
.

Replication - . WAL .





WAL - WAL WAL. WAL .





Vacuum Maintenance - autovacuum. .





Background Writes - ( WAL ). .





Disk space usage - , , , , . .





Tables - - topN INSERT/UPDATE/DELETE . , , .





WAL Archiving - WAL ( ). .





System resources usage - CPU .





In total, we got 37 hidden charts.
37 .

Pgbouncer

Utilization - ( ). .





Connections - . , pgbouncer.





Processing - , , . . Postgres.





System

- . Explore ad-hoc .





Overview - - CPU, , , - .





CPU, Storage utilization - - .





Storage - , IOPS ( discards flushes ).





Network - , , .





Memory, swap - .





Disk space - .





everything is ok, but the percent is pretty well loaded
,

. , , .





.








All Articles