Skip to content

Commit

Permalink
Expire large bank send metrics after 3 days
Browse files Browse the repository at this point in the history
  • Loading branch information
philipsu522 committed Aug 28, 2023
1 parent 077e9fb commit 324ce27
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions events.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ func (s EventCollector) HandleBankTransferEvent(eventItem *coretypes.EventItem)
"sender": sender,
"recipient": recipient,
}).Add(amount)
// Expire the metrics after sufficient investigation (3 days)
go func() {
time.Sleep(3 * 24 * time.Hour)
s.counter.Delete(prometheus.Labels{
"denom": denom,
"sender": sender,
"recipient": recipient,
})
}()
}
}
}
Expand Down

0 comments on commit 324ce27

Please sign in to comment.