Re: Question on Alerts - Mailing list pgsql-general

From Guillaume Lelarge
Subject Re: Question on Alerts
Date
Msg-id 54274170-49f7-4c88-8c23-431d50dd6a9f@dalibo.com
Whole thread Raw
In response to Question on Alerts  (sud <suds1434@gmail.com>)
Responses Re: Question on Alerts
List pgsql-general
Hi,

On 16/02/2025 14:29, sud wrote:
> Hi,
> We are asked to have key monitoring or alerting added to our postgres 
> database. And I am thinking of metrics like blocked transactions, Max 
> used transaction Ids,  Max Active session threshold, Deadlock, Long 
> running query,  replica lag, buffer cache hit ratio, read/write IOPS or 
> latency etc. I have below questions
> 
> 1)Below are some which i tried writing, can you please let me know if 
> these are accurate?
> 2)How should we be writing the alerting query for deadlock, max used 
> transaction ids, read/write IOPS and latency?
> 3)Are there any docs available which have these sample sql queries on 
> the pg_* table for these critical alerts which we can easily configure 
> through any tool?
> 4)Any other alerts which we should be really having?
> 

You should probably look at check_postgres and check_pgactivity. Their 
source code contain numerous SQL queries, that could help you write your 
own.

Regards.


-- 
Guillaume Lelarge
Consultant
https://dalibo.com



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Question on Alerts
Next
From: Adrian Klaver
Date:
Subject: Re: Help in vetting outcome of "vacuumdb --analyze-in-stages" - during DB Upgrade from EC2- PGS - Community Edn ver 13.X to 14.X