From dd87ad094a9497350e9626da7b5bc4593c7a1fbd Mon Sep 17 00:00:00 2001 From: Felix Yuan Date: Tue, 27 Jun 2023 11:18:02 -0700 Subject: [PATCH] Bug Fix: Fix lingering type issues (#828) * Fix postmaster type issue * Disable postmaster collector by default --------- Signed-off-by: Felix Yuan --- collector/pg_postmaster.go | 4 ++-- collector/pg_process_idle.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/collector/pg_postmaster.go b/collector/pg_postmaster.go index 4bef4296..b81e4f90 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 { @@ -44,7 +44,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 { diff --git a/collector/pg_process_idle.go b/collector/pg_process_idle.go index cc53fbb7..c22be632 100644 --- a/collector/pg_process_idle.go +++ b/collector/pg_process_idle.go @@ -84,7 +84,7 @@ func (PGProcessIdleCollector) Update(ctx context.Context, inst *instance, ch cha var applicationName sql.NullString var secondsSum sql.NullInt64 var secondsCount sql.NullInt64 - var seconds []int64 + var seconds []uint64 var secondsBucket []uint64 err := row.Scan(&applicationName, &secondsSum, &secondsCount, &seconds, &secondsBucket)