Skip to content

Commit

Permalink
fix: metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
istae committed Sep 23, 2023
1 parent 71efe29 commit 78e8e17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/pullsync/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
type metrics struct {
Offered prometheus.Counter // number of chunks offered
Wanted prometheus.Counter // number of chunks wanted
MissingChunks prometheus.Counter // number of reserve get errs
Delivered prometheus.Counter // number of chunk deliveries
Sent prometheus.Counter // number of chunks sent
DuplicateRuid prometheus.Counter // number of duplicate RUID requests we got
Expand All @@ -34,6 +35,12 @@ func newMetrics() metrics {
Name: "chunks_wanted",
Help: "Total chunks wanted.",
}),
MissingChunks: prometheus.NewCounter(prometheus.CounterOpts{
Namespace: m.Namespace,
Subsystem: subsystem,
Name: "missing_chunks",
Help: "Total reserve get errors.",
}),
Delivered: prometheus.NewCounter(prometheus.CounterOpts{
Namespace: m.Namespace,
Subsystem: subsystem,
Expand Down
1 change: 1 addition & 0 deletions pkg/pullsync/pullsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ func (s *Syncer) processWant(ctx context.Context, o *pb.Offer, w *pb.Want) ([]sw
if err != nil {
s.logger.Error(err, "processing want: unable to find chunk", "chunk_address", addr, "batch_id", ch.BatchID)
chunks = append(chunks, swarm.NewChunk(swarm.ZeroAddress, nil))
s.metrics.MissingChunks.Inc()
continue
}
chunks = append(chunks, c)
Expand Down

0 comments on commit 78e8e17

Please sign in to comment.