You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
981 B

  1. package synchronizer
  2. import "github.com/prometheus/client_golang/prometheus"
  3. var (
  4. metricReorgsCount = prometheus.NewCounter(
  5. prometheus.CounterOpts{
  6. Name: "sync_reorgs",
  7. Help: "",
  8. },
  9. )
  10. metricSyncedLastBlockNum = prometheus.NewGauge(
  11. prometheus.GaugeOpts{
  12. Name: "sync_synced_last_block_num",
  13. Help: "",
  14. },
  15. )
  16. metricEthLastBlockNum = prometheus.NewGauge(
  17. prometheus.GaugeOpts{
  18. Name: "sync_eth_last_block_num",
  19. Help: "",
  20. },
  21. )
  22. metricSyncedLastBatchNum = prometheus.NewGauge(
  23. prometheus.GaugeOpts{
  24. Name: "sync_synced_last_batch_num",
  25. Help: "",
  26. },
  27. )
  28. metricEthLastBatchNum = prometheus.NewGauge(
  29. prometheus.GaugeOpts{
  30. Name: "sync_eth_last_batch_num",
  31. Help: "",
  32. },
  33. )
  34. )
  35. func init() {
  36. prometheus.MustRegister(metricReorgsCount)
  37. prometheus.MustRegister(metricSyncedLastBlockNum)
  38. prometheus.MustRegister(metricEthLastBlockNum)
  39. prometheus.MustRegister(metricSyncedLastBatchNum)
  40. prometheus.MustRegister(metricEthLastBatchNum)
  41. }