Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tjhRs-00CbUK-Qx for pgsql-general@arkaria.postgresql.org; Sun, 16 Feb 2025 16:24:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tjhRr-009KoW-IP for pgsql-general@arkaria.postgresql.org; Sun, 16 Feb 2025 16:24:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tjhRr-009KoI-7P for pgsql-general@lists.postgresql.org; Sun, 16 Feb 2025 16:24:51 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tjhRn-001Bdz-0A for pgsql-general@lists.postgresql.org; Sun, 16 Feb 2025 16:24:50 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id CB3CD11401A8; Sun, 16 Feb 2025 11:24:44 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Sun, 16 Feb 2025 11:24:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1739723084; x=1739809484; bh=CL2H5SIRd0P3IlKAt1+czCyiG9rrNNozLNjSSloIPPY=; b= M/eUC3jr6vMTsxTKPak/3thPPqgkaPzsKY2dTYVmaMzpqmvomtppeJ5YeF2f4Yto cq3Cor02pt3PEwa+BI0DOK1NSRhpVHtZpyjr1R9V9HoNoM7WwO/XZyjBl3BfRx8D ZsiYgfP4XzO1aD8UEl2AjFz1kKoqcPZZxqbMEn5B2sqj4A3BG71DFGMmblQxfz4J cgYteJI0y5U5kcQZHKJG18Id7JdNjOP5B03oPqHcGSPo+Vzhr5GdYPv56BP/p3Ro v9B/GC8I0xyLx4YfKhqGXl3cvYjYkKGT5ABsQWDP3fwNHCriowsxXwVc++EkwftB 5uUXtWhbet3+fQojqCiuzQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1739723084; x=1739809484; bh=C L2H5SIRd0P3IlKAt1+czCyiG9rrNNozLNjSSloIPPY=; b=gy4OBoyMrK3ZOuiya xjfvnclPtsTzDdmQmX0zY5pgTYBbMdXCQ/4w40HyvKd2aStEwozxIcUD6lBWtZsm jkp23Pbdg04fvxUTM0eqFYTT6elvDhuYkZVO0FAbZw4yJrPFOrGJEdsVPUPDByqO VwVMXx7Z4/+RiQxYcYTHDX7kWkiQ6Zhz7p5An2O6hel8M9VSMbROAzaUU/5Cr+V7 954R8HnGoTmZ7sqcQz+yABvZRGazdoubrDY+QVfwN7ZgDVxv5j83ZMT66RHPpXBk QP1vXKUYDesBIwrBJZsIXTSNsaqI/Huu45E5YMG7sUj2ADT9gW35iY9PI/ApwRMk 7lPuw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdehheelfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgg gfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomheptegurhhirghnucfmlhgrvhgv rhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrg htthgvrhhnpeelgeevkeekkeeuiefgtdevieeluefhfedufeetkeejffekjeeujeehgeeh geektdenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgv rhesrghklhgrvhgvrhdrtghomhdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtph houhhtpdhrtghpthhtohepshhuughsudegfeegsehgmhgrihhlrdgtohhmpdhrtghpthht ohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorh hg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 16 Feb 2025 11:24:44 -0500 (EST) Message-ID: <70589303-83d2-46f3-b192-6b4682db7b75@aklaver.com> Date: Sun, 16 Feb 2025 08:24:43 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Question on Alerts To: sud , pgsql-general References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/16/25 05: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? Somewhere to start: https://wiki.postgresql.org/wiki/Category:Administration#Routine_maintenance_and_monitoring > Regards > Yudhi -- Adrian Klaver adrian.klaver@aklaver.com