mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-08 18:22:18 +00:00
fix: move to slog
Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com>
This commit is contained in:
parent
f2fe2d176b
commit
f682fed50c
@ -18,7 +18,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/go-kit/log"
|
"log/slog"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -27,7 +28,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PGIndexCollector struct {
|
type PGIndexCollector struct {
|
||||||
log log.Logger
|
log *slog.Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
const pgIndexSubsystem = "index"
|
const pgIndexSubsystem = "index"
|
||||||
|
@ -18,9 +18,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"log/slog"
|
||||||
|
|
||||||
"github.com/blang/semver/v4"
|
"github.com/blang/semver/v4"
|
||||||
"github.com/go-kit/log"
|
|
||||||
"github.com/go-kit/log/level"
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PGStatUserIndexesCollector struct {
|
type PGStatUserIndexesCollector struct {
|
||||||
log log.Logger
|
log *slog.Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
const statUserIndexesSubsystem = "stat_user_indexes"
|
const statUserIndexesSubsystem = "stat_user_indexes"
|
||||||
@ -137,7 +137,7 @@ func (c *PGStatUserIndexesCollector) Update(ctx context.Context, instance *insta
|
|||||||
}
|
}
|
||||||
|
|
||||||
if lastIdxScanAvail && !lastIdxScan.Valid {
|
if lastIdxScanAvail && !lastIdxScan.Valid {
|
||||||
level.Debug(c.log).Log("msg", "Skipping collecting metric because it has no active_time")
|
c.log.Debug("Skipping collecting metric because it has no active_time")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user