Skip to content

Commit f682fed

Browse files
fix: move to slog
Signed-off-by: Michael Todorovic <[email protected]>
1 parent f2fe2d1 commit f682fed

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

collector/pg_index.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import (
1818
"fmt"
1919
"strings"
2020

21-
"github.com/go-kit/log"
21+
"log/slog"
22+
2223
"github.com/prometheus/client_golang/prometheus"
2324
)
2425

@@ -27,7 +28,7 @@ func init() {
2728
}
2829

2930
type PGIndexCollector struct {
30-
log log.Logger
31+
log *slog.Logger
3132
}
3233

3334
const pgIndexSubsystem = "index"

collector/pg_stat_user_indexes.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import (
1818
"fmt"
1919
"strings"
2020

21+
"log/slog"
22+
2123
"github.com/blang/semver/v4"
22-
"github.com/go-kit/log"
23-
"github.com/go-kit/log/level"
2424
"github.com/prometheus/client_golang/prometheus"
2525
)
2626

@@ -29,7 +29,7 @@ func init() {
2929
}
3030

3131
type PGStatUserIndexesCollector struct {
32-
log log.Logger
32+
log *slog.Logger
3333
}
3434

3535
const statUserIndexesSubsystem = "stat_user_indexes"
@@ -137,7 +137,7 @@ func (c *PGStatUserIndexesCollector) Update(ctx context.Context, instance *insta
137137
}
138138

139139
if lastIdxScanAvail && !lastIdxScan.Valid {
140-
level.Debug(c.log).Log("msg", "Skipping collecting metric because it has no active_time")
140+
c.log.Debug("Skipping collecting metric because it has no active_time")
141141
continue
142142
}
143143

0 commit comments

Comments
 (0)