Skip to content

Commit

Permalink
Add witness ID label to distribute counter.
Browse files Browse the repository at this point in the history
  • Loading branch information
jiggoha committed Apr 2, 2024
1 parent 4c56ad5 commit 6a393ad
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cmd/internal/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ import (
const maxSigs = 100

var (
counterCheckpointUpdateRequests = promauto.NewCounter(prometheus.CounterOpts{
Name: "distributor_update_checkpoint_request",
Help: "The total number of requests to update a checkpoint",
})
counterCheckpointUpdateRequests = promauto.NewCounterVec(
prometheus.CounterOpts{
Name: "distributor_update_checkpoint_request",
Help: "The total number of requests to update a checkpoint, partitioned by witness ID.",
},
[]string{"witness_id"},
)
counterCheckpointUpdateSuccess = promauto.NewCounter(prometheus.CounterOpts{
Name: "distributor_update_checkpoint_success",
Help: "The total number of successful requests to update a checkpoint",
Expand Down Expand Up @@ -162,7 +165,7 @@ func (d *Distributor) GetCheckpointWitness(ctx context.Context, logID, witID str
// by both the log and the witness specified, and be larger than any previous checkpoint distributed
// for this pair.
func (d *Distributor) Distribute(ctx context.Context, logID, witID string, nextRaw []byte) error {
counterCheckpointUpdateRequests.Inc()
counterCheckpointUpdateRequests.WithLabelValues(witID).Inc()

l, ok := d.ls[logID]
if !ok {
Expand Down

0 comments on commit 6a393ad

Please sign in to comment.