Add sender address to alert

This commit is contained in:
Kirill Fedoseev 2022-04-21 10:39:54 +02:00
parent e0f4bcae95
commit 4f50ac0e15
2 changed files with 5 additions and 0 deletions

View File

@ -666,6 +666,7 @@ type StuckErcToNativeMessage struct {
TransactionHash common.Hash `db:"transaction_hash"` TransactionHash common.Hash `db:"transaction_hash"`
MsgHash common.Hash `db:"msg_hash"` MsgHash common.Hash `db:"msg_hash"`
Count uint64 `db:"count"` Count uint64 `db:"count"`
Sender common.Address `db:"sender"`
Receiver common.Address `db:"receiver"` Receiver common.Address `db:"receiver"`
Value string `db:"value"` Value string `db:"value"`
} }
@ -678,6 +679,7 @@ func (c *StuckErcToNativeMessage) AlertValues() AlertValues {
"tx_hash": c.TransactionHash.String(), "tx_hash": c.TransactionHash.String(),
"msg_hash": c.MsgHash.String(), "msg_hash": c.MsgHash.String(),
"count": strconv.FormatUint(c.Count, 10), "count": strconv.FormatUint(c.Count, 10),
"sender": c.Sender.String(),
"receiver": c.Receiver.String(), "receiver": c.Receiver.String(),
"value": c.Value, "value": c.Value,
}, },
@ -693,6 +695,7 @@ func (p *DBAlertsProvider) FindStuckErcToNativeMessages(ctx context.Context, par
sm.msg_hash, sm.msg_hash,
count(s.log_id) as count, count(s.log_id) as count,
EXTRACT(EPOCH FROM now() - ts.timestamp)::int as age, EXTRACT(EPOCH FROM now() - ts.timestamp)::int as age,
m.sender,
m.receiver, m.receiver,
m.value / 1e18 as value m.value / 1e18 as value
FROM sent_messages sm FROM sent_messages sm
@ -713,6 +716,7 @@ func (p *DBAlertsProvider) FindStuckErcToNativeMessages(ctx context.Context, par
sm.msg_hash, sm.msg_hash,
count(s.log_id) as count, count(s.log_id) as count,
EXTRACT(EPOCH FROM now() - ts.timestamp)::int as age, EXTRACT(EPOCH FROM now() - ts.timestamp)::int as age,
m.sender,
m.receiver, m.receiver,
m.value / 1e18 as value m.value / 1e18 as value
FROM sent_messages sm FROM sent_messages sm

View File

@ -124,6 +124,7 @@ Stuck ERC_TO_NATIVE message confirmation
*Block number:* {{ .CommonLabels.block_number }} *Block number:* {{ .CommonLabels.block_number }}
*Age:* {{ .CommonAnnotations.age }} *Age:* {{ .CommonAnnotations.age }}
*Collected confirmations:* {{ $count := "" }}{{ range .Alerts }}{{ $count = .Labels.count }}{{ end }}{{ $count }} *Collected confirmations:* {{ $count := "" }}{{ range .Alerts }}{{ $count = .Labels.count }}{{ end }}{{ $count }}
*Sender:* {{ .CommonLabels.sender }}
*Receiver:* {{ .CommonLabels.receiver }} *Receiver:* {{ .CommonLabels.receiver }}
*Value:* {{ .CommonLabels.value }} *Value:* {{ .CommonLabels.value }}
*Tx:* {{ template "explorer.tx.link" .CommonLabels }} *Tx:* {{ template "explorer.tx.link" .CommonLabels }}