Skip to content

Commit

Permalink
Merge pull request #2524 from OffchainLabs/fewer-dynamic-das-aggregat…
Browse files Browse the repository at this point in the history
…or-metrics

Remove some dynamically generated metrics from DAS
  • Loading branch information
PlasmaPower authored Jul 29, 2024
2 parents fcb1e32 + e77c50b commit 5762e64
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions das/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,7 @@ func (a *Aggregator) Store(ctx context.Context, message []byte, timeout uint64)
cert, err := d.service.Store(storeCtx, message, timeout)
if err != nil {
incFailureMetric()
if errors.Is(err, context.DeadlineExceeded) {
metrics.GetOrRegisterCounter(metricWithServiceName+"/error/timeout/total", nil).Inc(1)
} else {
metrics.GetOrRegisterCounter(metricWithServiceName+"/error/client/total", nil).Inc(1)
}
log.Warn("DAS Aggregator failed to store batch to backend", "backend", d.metricName, "err", err)
responses <- storeResponse{d, nil, err}
return
}
Expand All @@ -207,13 +203,13 @@ func (a *Aggregator) Store(ctx context.Context, message []byte, timeout uint64)
)
if err != nil {
incFailureMetric()
metrics.GetOrRegisterCounter(metricWithServiceName+"/error/bad_response/total", nil).Inc(1)
log.Warn("DAS Aggregator couldn't parse backend's store response signature", "backend", d.metricName, "err", err)
responses <- storeResponse{d, nil, err}
return
}
if !verified {
incFailureMetric()
metrics.GetOrRegisterCounter(metricWithServiceName+"/error/bad_response/total", nil).Inc(1)
log.Warn("DAS Aggregator failed to verify backend's store response signature", "backend", d.metricName, "err", err)
responses <- storeResponse{d, nil, errors.New("signature verification failed")}
return
}
Expand All @@ -222,13 +218,13 @@ func (a *Aggregator) Store(ctx context.Context, message []byte, timeout uint64)

if cert.DataHash != expectedHash {
incFailureMetric()
metrics.GetOrRegisterCounter(metricWithServiceName+"/error/bad_response/total", nil).Inc(1)
log.Warn("DAS Aggregator got a store response with a data hash not matching the expected hash", "backend", d.metricName, "dataHash", cert.DataHash, "expectedHash", expectedHash, "err", err)
responses <- storeResponse{d, nil, errors.New("hash verification failed")}
return
}
if cert.Timeout != timeout {
incFailureMetric()
metrics.GetOrRegisterCounter(metricWithServiceName+"/error/bad_response/total", nil).Inc(1)
log.Warn("DAS Aggregator got a store response with any expiry time not matching the expected expiry time", "backend", d.metricName, "dataHash", cert.DataHash, "expectedHash", expectedHash, "err", err)
responses <- storeResponse{d, nil, fmt.Errorf("timeout was %d, expected %d", cert.Timeout, timeout)}
return
}
Expand Down

0 comments on commit 5762e64

Please sign in to comment.