Netdata Community

Python.d/postgres plugin: add pg_stat_statements metrics for monitoring database queries

Problem/Question

I experiment with the addition of pg_stat_statements metrics to monitor queries to PostgreSQL in Netdata (python.d/postgres plugin), and I have some difficulties with adding the new charts.

In fact, I can now add Top-1 metrics (e.g., max total time)

But I have a questions:

  1. How to add a queryid to a chart?
  2. How to add multiple values in chart for each queryid?

Here are the changes that I made in postgres.chart.py:

I am not strong in programming on Python, so I will be glad to any help in this matter.

What I expected to happen

Add stat_statements charts with multiple values for each queryid.

Example: