Skip to content

Commit e3a73d3

Browse files
committed
Expect a floating point value for the total seconds
Signed-off-by: Tom Hughes <[email protected]>
1 parent 80b01e9 commit e3a73d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

collector/pg_process_idle.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (PGProcessIdleCollector) Update(ctx context.Context, instance *instance, ch
8383
GROUP BY 1, 2, 3;`)
8484

8585
var applicationName sql.NullString
86-
var secondsSum sql.NullInt64
86+
var secondsSum sql.NullFloat64
8787
var secondsCount sql.NullInt64
8888
var seconds []float64
8989
var secondsBucket []int64
@@ -112,7 +112,7 @@ func (PGProcessIdleCollector) Update(ctx context.Context, instance *instance, ch
112112
}
113113
secondsSumMetric := 0.0
114114
if secondsSum.Valid {
115-
secondsSumMetric = float64(secondsSum.Int64)
115+
secondsSumMetric = secondsSum.Float64
116116
}
117117
ch <- prometheus.MustNewConstHistogram(
118118
pgProcessIdleSeconds,

0 commit comments

Comments
 (0)