Skip to content

feat(l1,l2): add ethereum metrics exporter and grafana support #2434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/networking/rpc/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ pub fn version(_req: &RpcRequest, context: RpcApiContext) -> Result<Value, RpcEr
let value = serde_json::to_value(format!("{}", chain_spec.chain_id))?;
Ok(value)
}

// dummy function
pub fn peer_count(_req: &RpcRequest, _context: RpcApiContext) -> Result<Value, RpcErr> {
let value = serde_json::to_value("0")?;
Ok(value)
}
1 change: 1 addition & 0 deletions crates/networking/rpc/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ pub fn map_web3_requests(req: &RpcRequest, context: RpcApiContext) -> Result<Val
pub fn map_net_requests(req: &RpcRequest, contex: RpcApiContext) -> Result<Value, RpcErr> {
match req.method.as_str() {
"net_version" => net::version(req, contex),
"net_peerCount" => net::peer_count(req, contex),
unknown_net_method => Err(RpcErr::MethodNotFound(unknown_net_method.to_owned())),
}
}
Expand Down
7 changes: 7 additions & 0 deletions test_data/network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ network_params:
# The address of the staking contract address on the Eth1 chain
deposit_contract_address: "0x4242424242424242424242424242424242424242"

ethereum_metrics_exporter_enabled: true

additional_services:
- dora
- forkmon
- tx_fuzz
- prometheus_grafana

tx_fuzz_params:
# A list of optional extra params that will be passed to the TX Fuzz container for modifying its behaviour
Expand All @@ -46,3 +49,7 @@ blockscout_params:
image: "blockscout/blockscout:latest"
verif_image: "ghcr.io/blockscout/smart-contract-verifier:latest"
frontend_image: "ghcr.io/blockscout/frontend:latest"

prometheus_params:
# TODO: switch to latest when it points to v3.x
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when what points to v3.x?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "latest" tag. Currently it's 2.x

image: "prom/prometheus:v3.2.1"