From 9d91a568979117ac318d73ccc0271a5601c9d6bb Mon Sep 17 00:00:00 2001 From: Felix Yuan Date: Tue, 27 Jun 2023 09:08:58 -0700 Subject: [PATCH 1/3] Fix postmaster type issue Signed-off-by: Felix Yuan --- collector/pg_postmaster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/pg_postmaster.go b/collector/pg_postmaster.go index eae82d567..c2acd5182 100644 --- a/collector/pg_postmaster.go +++ b/collector/pg_postmaster.go @@ -43,7 +43,7 @@ var ( []string{}, nil, ) - pgPostmasterQuery = "SELECT pg_postmaster_start_time from pg_postmaster_start_time();" + pgPostmasterQuery = "SELECT extract(epoch from pg_postmaster_start_time) from pg_postmaster_start_time();" ) func (c *PGPostmasterCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error { From 4a59363dfe20aafe54a80e5bdceaa33ea94100ec Mon Sep 17 00:00:00 2001 From: Felix Yuan Date: Tue, 27 Jun 2023 09:17:03 -0700 Subject: [PATCH 2/3] Process idle complaining about uint Signed-off-by: Felix Yuan --- collector/pg_process_idle.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/pg_process_idle.go b/collector/pg_process_idle.go index 06244975b..559cfd04d 100644 --- a/collector/pg_process_idle.go +++ b/collector/pg_process_idle.go @@ -82,7 +82,7 @@ func (PGProcessIdleCollector) Update(ctx context.Context, instance *instance, ch var applicationName string var secondsSum int64 var secondsCount uint64 - var seconds []int64 + var seconds []uint64 var secondsBucket []uint64 err := row.Scan(&applicationName, &secondsSum, &secondsCount, &seconds, &secondsBucket) From d5b196e07767bb59678fe6cce1c26f71f04c14aa Mon Sep 17 00:00:00 2001 From: Felix Yuan Date: Tue, 27 Jun 2023 10:34:11 -0700 Subject: [PATCH 3/3] Flip postmaster collector to disabled by default Signed-off-by: Felix Yuan --- collector/pg_postmaster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/pg_postmaster.go b/collector/pg_postmaster.go index 08446a544..b81e4f905 100644 --- a/collector/pg_postmaster.go +++ b/collector/pg_postmaster.go @@ -23,7 +23,7 @@ import ( const postmasterSubsystem = "postmaster" func init() { - registerCollector(postmasterSubsystem, defaultEnabled, NewPGPostmasterCollector) + registerCollector(postmasterSubsystem, defaultDisabled, NewPGPostmasterCollector) } type PGPostmasterCollector struct {