feat(app): Charon-parity monitoring metrics and custom testnet support - #566
Open
varex83 wants to merge 1 commit into
Open
feat(app): Charon-parity monitoring metrics and custom testnet support#566varex83 wants to merge 1 commit into
varex83 wants to merge 1 commit into
Conversation
…pport
Expose the startup and cluster gauges Charon sets in initStartupMetrics
(app_version, app_peer_name, app_git_commit, app_start_time_secs,
cluster_threshold/operators/validators) and stamp the global cluster_*
labels (cluster_hash, cluster_name, cluster_network, cluster_peer,
charon_version, nickname) onto every series in the /metrics exposition so
the Charon dashboard template variables resolve.
Register a fully-specified custom testnet from --testnet-* before the node
resolves the cluster fork version, replacing the previous "unsupported"
rejection; partially-specified flags stay ignored (IsNonZero parity).
Coerce the build git hash into Charon's ^[0-9a-f]{7}$ peerinfo form so
git-less builds still advertise a well-formed hash and stay visible to
Charon peers instead of having their entire peerinfo record dropped.
iamquang95
reviewed
Jul 27, 2026
iamquang95
left a comment
Collaborator
There was a problem hiding this comment.
please merge the main
| // are ignored (Charon parity, `IsNonZero`-gated). `Box::leak` promotes the | ||
| // runtime strings to `'static` as required by `Network`; the leak is | ||
| // bounded (one custom testnet per process) and matches `create cluster`. | ||
| let testnet = testnet |
Collaborator
There was a problem hiding this comment.
This should be on main already
| // version up in the supported-networks allowlist. Registration is | ||
| // idempotent (keyed on genesis fork version). | ||
| if let Some(testnet) = &config.testnet { | ||
| pluto_eth2util::network::add_test_network(testnet.clone()) |
Collaborator
There was a problem hiding this comment.
this should be on main already
| MONITORING_METRICS.peer_name[&peer_name.to_owned()].set(1); | ||
| MONITORING_METRICS.git_commit[&git_hash.to_owned()].set(1); | ||
| MONITORING_METRICS.start_time_secs.set(start_time_secs); | ||
|
|
Collaborator
There was a problem hiding this comment.
missing cluster_network and app_feature_flags
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings three Charon parity gaps in the
appcrate up to functional equivalence.Monitoring metrics parity (
initStartupMetrics+ global labels)app_version,app_peer_name,app_git_commit,app_start_time_secsand the cluster-lock gaugescluster_threshold/cluster_operators/cluster_validators, all set via a newinit_startup_metrics(...).cluster_*labels (cluster_hash,cluster_name,cluster_network,cluster_peer,charon_version,nickname) onto every series in the/metricsexposition viaMonitoringState::with_labels, so the Charon dashboard's template variables resolve against Pluto's output.cluster_networkfalls back to"unknown"for unrecognised fork versions, matching Charon.Custom testnet support (
--testnet-*)AppConfigand registered (add_test_network) before the node resolves the cluster fork version, replacing the previous--testnet-* is not yet supportedrejection.IsNonZeroparity).Peerinfo git-hash coercion
git_commit_hash_short(), which coerces the build hash into Charon's^[0-9a-f]{7}$form. Charon drops a peer's entire peerinfo record when the git hash fails that regex, so git-less builds (e.g. Docker without.git) previously vanished from the cluster dashboard. Now they advertise a well-formed fallback hash and stay visible.Testing
/metricsseries, git-hash coercion/fallback, and--testnet-*acceptance/partial-ignore inbuild_app_config.🤖 Generated with Claude Code