Skip to content

Commit e6ce2ec

Browse files
authoredJun 27, 2023
Bug Fix: Fix lingering type issues (#828)
* Fix postmaster type issue * Disable postmaster collector by default --------- Signed-off-by: Felix Yuan <felix.yuan@reddit.com>
1 parent 030a2a9 commit e6ce2ec

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎collector/pg_postmaster.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
const postmasterSubsystem = "postmaster"
2424

2525
func init() {
26-
registerCollector(postmasterSubsystem, defaultEnabled, NewPGPostmasterCollector)
26+
registerCollector(postmasterSubsystem, defaultDisabled, NewPGPostmasterCollector)
2727
}
2828

2929
type PGPostmasterCollector struct {
@@ -44,7 +44,7 @@ var (
4444
[]string{}, nil,
4545
)
4646

47-
pgPostmasterQuery = "SELECT pg_postmaster_start_time from pg_postmaster_start_time();"
47+
pgPostmasterQuery = "SELECT extract(epoch from pg_postmaster_start_time) from pg_postmaster_start_time();"
4848
)
4949

5050
func (c *PGPostmasterCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error {

‎collector/pg_process_idle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (PGProcessIdleCollector) Update(ctx context.Context, instance *instance, ch
8484
var applicationName sql.NullString
8585
var secondsSum sql.NullInt64
8686
var secondsCount sql.NullInt64
87-
var seconds []int64
87+
var seconds []uint64
8888
var secondsBucket []uint64
8989

9090
err := row.Scan(&applicationName, &secondsSum, &secondsCount, &seconds, &secondsBucket)

0 commit comments

Comments
 (0)
Please sign in to comment.