Skip to content

Commit

Permalink
fix: AWS deploy: monitor.go: don't flood storage with alerts when err…
Browse files Browse the repository at this point in the history
…or in getting proofs

Co-authored-by: Jose Luis Lucas <[email protected]>
  • Loading branch information
panchoh and Jose Luis Lucas committed Mar 6, 2019
1 parent eed61d2 commit bc21782
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions gossip/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ var (
},
)

QedMonitorGetIncrementalProofErrTotal = prometheus.NewCounter(
prometheus.CounterOpts{
Name: "qed_monitor_get_incremental_proof_err_total",
Help: "Number of errors trying to get incremental proofs by monitors.",
},
)

metricsList = []prometheus.Collector{
QedAuditorInstancesCount,
QedMonitorInstancesCount,
Expand All @@ -110,6 +117,7 @@ var (
QedPublisherBatchesProcessSeconds,

QedAuditorGetMembershipProofErrTotal,
QedMonitorGetIncrementalProofErrTotal,
}
)

Expand Down
4 changes: 2 additions & 2 deletions gossip/monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ func (m Monitor) executeTask(task QueryTask) {
resp, err := m.client.Incremental(task.Start, task.End)
if err != nil {
// TODO: retry
m.sendAlert(fmt.Sprintf("Unable to verify incremental proof from %d to %d", task.Start, task.End))
log.Infof("Unable to verify incremental proof from %d to %d", task.Start, task.End)
metrics.QedMonitorGetIncrementalProofErrTotal.Inc()
log.Infof("Unable to get incremental proof from QED server: %s", err.Error())
return
}
ok := m.client.VerifyIncremental(resp, &task.StartSnapshot, &task.EndSnapshot, hashing.NewSha256Hasher())
Expand Down

0 comments on commit bc21782

Please sign in to comment.