feat(observability): enable metrics via config + operator monitoring setup - #99
feat(observability): enable metrics via config + operator monitoring setup#99luishsr wants to merge 1 commit into
Conversation
…setup Turn-on & unify (P1 of the Network Observability Initiative). The audit found the node is already instrumented — Narwhal/Mysten's full Prometheus suite plus reth's execution metrics — but everything is off by default, split across two registries, with no config-file route to enable it. This addresses the "turn on & unify" half. Config: both metrics endpoints are now enable-able from parameters.yaml — `metrics_address` (consensus/Narwhal suite) and `reth_metrics_address` (reth execution layer), both Option<SocketAddr> with #[serde(default)] so every existing config still parses and stays off. The `--metrics` / `--reth-metrics` CLI flags override the config values when passed; startup logs announce each active endpoint. Removes the dead `PrometheusMetricsParameters` struct (defined but wired nowhere, typed Multiaddr where the live path is SocketAddr). Fixes a stale `--enable-healthcheck` doc reference (the flag is `--healthcheck`). Monitoring: etc/monitoring/ ships a ready-to-run Prometheus + Grafana + node_exporter setup — a two-target scrape config (consensus + execution + host, labeled by `layer`, resolving the split-registry issue), a docker-compose stack, Grafana datasource provisioning, and a README pointing operators at reth's official Grafana dashboard (#20638). The Rayls consensus/validator dashboard is the next deliverable (#428). Refs: raylsnetwork/axyl-private#381 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @luishsr's task in 3m 20s —— View job PR Review
SummaryClean, well-scoped PR. The config changes are backward-compatible and idiomatic, the dead Medium — Startup log inconsistency
The simplest fix is to write the merged value back into // in network-cli/src/node.rs, after the merge
rayls_infrastructure_config.parameters.metrics_address = metrics;
rayls_infrastructure_config.parameters.reth_metrics_address = reth.reth_metrics.prometheus;That way Medium — No validation that the two addresses don't collide
if self.metrics_address == self.reth_metrics_address && self.metrics_address.is_some() {
tracing::warn!("metrics_address and reth_metrics_address are the same — one will fail to bind");
}Low — Log message inconsistency
Different capitalisation, different wording ("endpoint" vs "enabled"). If both fire (config-file path), an operator reading the structured log will see two differently-worded lines for the same event. Standardise to one message and one call site (see Medium issue above). Low — Docker image tags not pinned
Nit —
|
Security Scan - CodeSeverity: HIGH, CRITICAL No vulnerabilities found View scan results |
|
Thanks for the research done! |
|
Thanks @bronxyz — and good context on the scripts. One clarification on how this interacts with the flag-based setup, since it changes the picture: the CLI flags take precedence over config. In Given that, the only open question is whether the config path is worth keeping as an additive option:
I'm happy either way — which do you prefer? If flags-only, I'll strip the two config fields and keep the rest. |
|
I'd say we can keep the params as fallback, but let's align the ports with the script defaults, so we can avoid any potential ports collision. |
What
The "turn on & unify" P1 of the Network Observability Initiative (
axyl-private#429, research task#381). The research audit found the node is already heavily instrumented — it inherited Narwhal/Mysten's full Prometheus suite (consensus/primary/worker/network/executor metrics) and has reth's execution metrics — but everything is off by default, split across two registries, with no config-file route to enable it. This PR closes the turn-on & unify gaps.Config — enable metrics from
parameters.yamlBoth endpoints are now enable-able from config, not just CLI flags:
Option<SocketAddr>with#[serde(default)]— every existingparameters.yamlstill parses and stays off (covered by tests).--metrics/--reth-metricsCLI flags override the config values when passed (mirrors the existing--networkoverride); startup logs announce each active endpoint.PrometheusMetricsParametersstruct — defined with aDefaultimpl but wired nowhere, and typedMultiaddrwhere the live path isSocketAddr.--enable-healthcheckdoc reference (the real flag is--healthcheck).Monitoring —
etc/monitoring/A ready-to-run operator stack:
prometheus.yml— a two-target scrape (consensus + execution +node_exporter), labeled bylayer, which resolves the split-registry issue (the two endpoints live in separate registries, so they're scraped as separate jobs).docker-compose.yml— one-command Prometheus + Grafana + node_exporter.Tests
4
config::node::testscover backward-compat (no field → off), parsing when present, and the defaults for both endpoints. Compiles clean.Scope / next
This is turn-on & unify only. The validator-identity metrics layer (per-validator liveness/participation, committee/epoch/reputation), a real readiness probe, and a Rayls consensus/validator Grafana dashboard are the next deliverable, tracked in
#428. The full research (current-state audit + reuse-vs-build) is attached to#381.🤖 Generated with Claude Code