Skip to content

Commit

Permalink
fix: move to slog
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com>
  • Loading branch information
michael-todorovic committed Nov 18, 2024
1 parent f2fe2d1 commit f682fed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions collector/pg_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import (
"fmt"
"strings"

"github.com/go-kit/log"
"log/slog"

"github.com/prometheus/client_golang/prometheus"
)

Expand All @@ -27,7 +28,7 @@ func init() {
}

type PGIndexCollector struct {
log log.Logger
log *slog.Logger
}

const pgIndexSubsystem = "index"
Expand Down
8 changes: 4 additions & 4 deletions collector/pg_stat_user_indexes.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"fmt"
"strings"

"log/slog"

"github.com/blang/semver/v4"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
)

Expand All @@ -29,7 +29,7 @@ func init() {
}

type PGStatUserIndexesCollector struct {
log log.Logger
log *slog.Logger
}

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

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
}

Expand Down

0 comments on commit f682fed

Please sign in to comment.