vegaprotocol / vega-monitoring

MVP to store more data for metrics
MIT License
2 stars 1 forks source link

Add monitoring for secondary EVM events forwarded by validators #29

Open daniel1302 opened 1 month ago

daniel1302 commented 1 month ago

Background

We determine how many Ethereum events have been forwarded by each validator in the last 10 days. If it is low we fire the alarm.

Issue

At the moment We do not split it by chain. We count all events from all the EVM chains. But We are going to add Arbitrum soon and We would like to see when validators have problems with their Ethereum and Arbitrum separately

TODOs:

ValentinTrinque commented 1 month ago

SQL request for the Grafana chart.

WITH chain_event_count AS (
  SELECT submitter, COUNT(*) AS count, last(vega_time, vega_time) AS last, attributes->>'source-chain-id' as chain_id
  FROM comet_txs
  WHERE
      command = 'Chain Event' AND attributes ? 'source-chain-id'
    AND
      vega_time >= NOW() - INTERVAL '10 days'
  GROUP BY submitter, attributes->>'source-chain-id'
)
SELECT
  COALESCE(c.count, 0),
  CONCAT(n.name, ' (', c.chain_id , ') ', ' [', COALESCE(TO_CHAR(c.last,'DD Mon HH24:MI'), '-'), ']') AS description
FROM validator_nodes n
LEFT JOIN chain_event_count c ON c.submitter = encode(n.vega_pub_key, 'hex')
ORDER BY description