Skip to content

Commit

Permalink
change counter to gauge
Browse files Browse the repository at this point in the history
  • Loading branch information
Rick Bijkerk committed Aug 7, 2024
1 parent 9c39a99 commit e4a3cd1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/business/persistedoperations/dir_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

var (
fileLoaderCounter = prometheus.NewGaugeVec(prometheus.GaugeOpts{
fileLoaderGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: "graphql_protect",
Subsystem: "dir_loader",
Name: "files_loaded_gauge",
Expand All @@ -37,7 +37,7 @@ func NewLocalDirLoader(cfg Config, log *slog.Logger) *DirLoader {
}

func init() {
prometheus.MustRegister(fileLoaderCounter)
prometheus.MustRegister(fileLoaderGauge)
}

func (d *DirLoader) Load(_ context.Context) (map[string]PersistedOperation, error) {
Expand Down Expand Up @@ -80,7 +80,7 @@ func (d *DirLoader) Load(_ context.Context) (map[string]PersistedOperation, erro
}
}

fileLoaderCounter.WithLabelValues().Set(float64(filesProcessed))
fileLoaderGauge.WithLabelValues().Set(float64(filesProcessed))

return result, nil
}

0 comments on commit e4a3cd1

Please sign in to comment.