prometheus监控以太坊私链

启用metrics

openethereum --jsonrpc-interface 0.0.0.0    --jsonrpc-cors all --reseal-max-period 60000000 --metrics --metrics-interface=all
2023-01-30 11:33:12  Starting OpenEthereum
2023-01-30 11:33:12  State DB configuration: fast
2023-01-30 11:33:12  Operating mode: active
2023-01-30 11:33:12  Not preparing block; cannot sign.
2023-01-30 11:33:12  Configured for Hashii using AuthorityRound engine
2023-01-30 11:33:12  Signal for switch to contract-based validator set.
2023-01-30 11:33:12  Listening for new connections on 0.0.0.0:8546.
2023-01-30 11:33:12  Started prometeus metrics at http://0.0.0.0:3000/metrics
...
2023-01-30 11:37:16  Listening for new connections on 0.0.0.0:8546.
2023-01-30 11:37:16  Started prometeus metrics at http://0.0.0.0:3000/metrics

部署gethexporter

start_gethexporter.sh

#!/bin/bash

docker run -it -d -p 9091:9090 --restart=always   -e GETH="http://172.16.1.12:8545" hunterlong/gethexporter

prometheus.yml

  - job_name: "wgchain"
    static_configs:
      - targets: ["localhost:9091"]

grafana

import dashboard

查看私链 dashboard

posted @ 2023-01-31 11:26  小吉猫  阅读(112)  评论(0编辑  收藏  举报