thepalbi / ethereum-prometheus-exporter

Prometheus exporter for Ethereum client metrics
MIT License
1 stars 0 forks source link

Review failing metrics #5

Closed thepalbi closed 2 years ago

thepalbi commented 2 years ago

Whenever running the exporter, in whichever network, some metrics keep failing.

exporter_1  | * error collecting metric Desc{fqName: "net_peers", help: "number of peers currently connected to the client", constLabels: {}, variableLabels: []}: 400 Bad Request: {"jsonrpc": "2.0", "id": 4, "error": {"code": -32601, "message": "Unsupported method [net_peerCount]. See available methods at https://docs.alchemy.com/alchemy/documentation/apis"}}
exporter_1  | * error collecting metric Desc{fqName: "eth_block_timestamp", help: "timestamp of the most recent block", constLabels: {}, variableLabels: []}: 400 Bad Request: {"jsonrpc": "2.0", "id": 10, "error": {"code": -32602, "message": "Invalid method parameter(s)."}}
exporter_1  | * error collecting metric Desc{fqName: "parity_net_active_peers", help: "number of active peers", constLabels: {}, variableLabels: []}: 400 Bad Request: {"jsonrpc": "2.0", "id": 3, "error": {"code": -32601, "message": "Unsupported method [parity_netPeers]. See available methods at https://docs.alchemy.com/alchemy/documentation/apis"}}
exporter_1  | * error collecting metric Desc{fqName: "parity_net_connected_peers", help: "number of peers currently connected to this client", constLabels: {}, variableLabels: []}: 400 Bad Request: {"jsonrpc": "2.0", "id": 3, "error": {"code": -32601, "message": "Unsupported method [parity_netPeers]. See available methods at https://docs.alchemy.com/alchemy/documentation/apis"}}
exporter_1  | * error collecting metric Desc{fqName: "eth_hashrate", help: "hashes per second that this node is mining with", constLabels: {}, variableLabels: []}: 400 Bad Request: {"jsonrpc": "2.0", "id": 2, "error": {"code": -32601, "message": "Unsupported method [eth_hashrate]. See available methods at https://docs.alchemy.com/alchemy/documentation/apis"}}
exporter_1  | * error collecting metric Desc{fqName: "eth_latest_block_transactions", help: "number of transactions in the latest block", constLabels: {}, variableLabels: []}: invalid argument 0: hex string without 0x prefix
exporter_1  | * collected metric "erc20_transfer_event" { label:<name:"contract" value:"0x3845badAde8e6dFF049820680d1F14bD3903a5d0" > label:<name:"symbol" value:"SAND" > histogram:<sample_count:2 sample_sum:26.25 > } was collected before with the same name and label values
exporter_1  | * error collecting metric Desc{fqName: "eth_sync_starting", help: "block number at which current import started", constLabels: {}, variableLabels: []}: not syncing
exporter_1  | * error collecting metric Desc{fqName: "eth_sync_current", help: "number of most recent block", constLabels: {}, variableLabels: []}: not syncing
exporter_1  | * error collecting metric Desc{fqName: "eth_sync_highest", help: "estimated number of highest block", constLabels: {}, variableLabels: []}: not syncing

Maybe because this was originally designed for OpenEthereum?

evictorero commented 2 years ago

I am receiving less errors when starting with using mainnet with infura parity metrics: it says in the readme that they are only available for OpenEthereum. eth_block_timestamp: need to change an int parameter to bool and then it works. eth_sync: It is not failing, it's returned not syncing beause the node seems not be synced.

I can try to make a PR tomorrow to fix all of the other errors and try to find a better solution for the sync ones.

evictorero commented 2 years ago

Expected errors after PR changes using Infura:


exporter_1  | * error collecting metric Desc{fqName: "parity_net_active_peers", help: "number of active peers", constLabels: {}, variableLabels: []}: parity metrics are only available in OpenEthereum: The method parity_netPeers does not exist/is not available
exporter_1  | * error collecting metric Desc{fqName: "parity_net_connected_peers", help: "number of peers currently connected to this client", constLabels: {}, variableLabels: []}: parity metrics are only available in OpenEthereum: The method parity_netPeers does not exist/is not available
exporter_1  | * error collecting metric Desc{fqName: "eth_sync_starting", help: "block number at which current import started", constLabels: {}, variableLabels: []}: not syncing
exporter_1  | * error collecting metric Desc{fqName: "eth_sync_current", help: "number of most recent block", constLabels: {}, variableLabels: []}: not syncing
exporter_1  | * error collecting metric Desc{fqName: "eth_sync_highest", help: "estimated number of highest block", constLabels: {}, variableLabels: []}: not syncing