Cleanup collectors (#826)

Fix up `replication` and `process_idle` Update input params to match
the rest of the collectors.

Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
Ben Kochie
2023-06-27 16:40:12 +02:00
committed by GitHub
parent 1a4e8993f6
commit 030a2a9bc7
3 changed files with 7 additions and 5 deletions

View File

@@ -15,7 +15,6 @@ package collector
import (
"context"
"database/sql"
"github.com/prometheus/client_golang/prometheus"
)
@@ -64,7 +63,8 @@ var (
END as is_replica`
)
func (c *PGReplicationCollector) Update(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error {
func (c *PGReplicationCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error {
db := instance.getDB()
row := db.QueryRowContext(ctx,
pgReplicationQuery,
)