Skip to content

Commit

Permalink
chore: add a counter to include libs
Browse files Browse the repository at this point in the history
  • Loading branch information
IronCore864 committed Nov 11, 2024
1 parent 6f7b2fa commit f2ad4de
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internals/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import (
"time"

"github.com/gorilla/mux"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_golang/prometheus/promhttp"
"gopkg.in/tomb.v2"

Expand Down Expand Up @@ -398,6 +400,13 @@ func (d *Daemon) Init() error {
// No errors received within the timeout.
}

// Use counter metrics to include necessary libs.
opsProcessed := promauto.NewCounter(prometheus.CounterOpts{
Name: "myapp_processed_ops_total",
Help: "The total number of processed events",
})
opsProcessed.Inc()

logger.Noticef("Started daemon.")
return nil
}
Expand Down

0 comments on commit f2ad4de

Please sign in to comment.