Skip to content

Commit

Permalink
Merge pull request #420 from gyrter/fix_metrics
Browse files Browse the repository at this point in the history
Add metrics handler. Fixes #367
  • Loading branch information
ese authored Jul 28, 2022
2 parents 6e08a31 + b15fc1a commit b816ab6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/redisoperator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"time"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"

"github.com/spotahome/redis-operator/cmd/utils"
Expand Down Expand Up @@ -64,7 +65,8 @@ func (m *Main) Run() error {

// Serve metrics.
go func() {
log.Infof("Listening on %s for metrics exposure", m.flags.ListenAddr)
log.Infof("Listening on %s for metrics exposure on URL %s", m.flags.ListenAddr, m.flags.MetricsPath)
http.Handle(m.flags.MetricsPath, promhttp.Handler())
err := http.ListenAndServe(m.flags.ListenAddr, nil)
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit b816ab6

Please sign in to comment.