postgres_exporter
postgres_exporter copied to clipboard
How to generate QPS/TPS metrics with postgres_exporter?
Hi,
I'm using postgres_exporter in our production database, I prefer to know is there methd to generate QPS/TPS metrics for Postgres instance? or via extend.query-path how to achieve that? Thanks a lot
--extend.query-path=custom.queries.yaml
TPS - xact_commit in pg_stat_database QPS - calls in pg_stat_statements
--extend.query-path=custom.queries.yaml
TPS - xact_commit in pg_stat_database QPS - calls in pg_stat_statements
for QPS, calculate the difference between 1 second? i.e. sleep 1s count(calls) minus count(calls), or other method?
QPS is COUNTER, so just irate
with
a as (select sum(calls) s from pg_stat_statements),
b as (select sum(calls) s from pg_stat_statements , pg_sleep(1))
select
b.s-a.s -- QPS
from a,b;