Monorepo for Tangled tangled.org

knotmirror: add active resyncs gauge metric #1090

The pattern is:

resyncsActive.Inc() // +1 when resync starts defer resyncsActive.Dec() // -1 when resync finishes (success or failure)

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:i2fgba5nignuw4nccml33wjp/sh.tangled.repo.pull/3mfruw2wpbm22
+6 -2
Diff #0
+4 -2
knotmirror/metrics.go
··· 7 7 8 8 // Resync metrics 9 9 var ( 10 - // TODO: 11 - // - working / waiting resycner counts 10 + resyncsActive = promauto.NewGauge(prometheus.GaugeOpts{ 11 + Name: "knotmirror_resyncs_active", 12 + Help: "Number of repo resyncs currently in progress", 13 + }) 12 14 resyncsStarted = promauto.NewCounter(prometheus.CounterOpts{ 13 15 Name: "knotmirror_resyncs_started_total", 14 16 Help: "Total number of repo resyncs started",
+2
knotmirror/resyncer.go
··· 116 116 // defer span.End() 117 117 118 118 resyncsStarted.Inc() 119 + resyncsActive.Inc() 120 + defer resyncsActive.Dec() 119 121 startTime := time.Now() 120 122 121 123 success, err := r.doResync(ctx, repoAt)

History

1 round 0 comments
sign up or login to add to the discussion
1 commit
expand
knotmirror: add active resyncs gauge metric
expand 0 comments
closed without merging