Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYfmj-0007E3-Bk for pgsql-performance@arkaria.postgresql.org; Fri, 08 Oct 2021 02:38:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mYfmi-0007Zi-4n for pgsql-performance@arkaria.postgresql.org; Fri, 08 Oct 2021 02:38:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYfmh-0007Za-Ss for pgsql-performance@lists.postgresql.org; Fri, 08 Oct 2021 02:38:55 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYfmf-0000rb-6H for pgsql-performance@lists.postgresql.org; Fri, 08 Oct 2021 02:38:55 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1mYfmb-00089E-CE; Thu, 07 Oct 2021 22:38:49 -0400 Date: Thu, 7 Oct 2021 22:38:49 -0400 From: Bruce Momjian To: Jeremy Schneider Cc: Peter Geoghegan , Jeff Holt , pgsql-performance@lists.postgresql.org, Laurenz Albe Subject: Re: Better, consistent instrumentation for postgreSQL using a similar API as Oracle Message-ID: <20211008023849.GF5476@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Oct 7, 2021 at 07:15:39PM -0700, Jeremy Schneider wrote: > PostgreSQL added wait events starting in 9.6 and the last thing that's > missing is an integrated way to trace or log them. A simple starting > point could be a session-level GUC that enables a hook in > pgstat_report_wait_start() and pgstat_report_wait_end() to just drop > messages in the log. These log messages could then easily be processed > to generate the similar profiles to the ones we used with other > databases. Basically I agree 100% with Jeff that while you can do these > things with perf probes or eBPF, there are massive advantages to having > it baked in the database. With the right tools, this makes session > profiling available to regular users (who do their day jobs with excel > rather than eBPF). Our wait events reported in pg_stat_activity are really only a first step --- I always felt it needed an external tool to efficiently collect and report those wait events. I don't think the server log is the right place to collect them. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.