Add optional Prometheus metrics endpoint - #62
Open
danbryan wants to merge 1 commit into
Open
Conversation
Contributor
Greptile SummaryThe PR adds an opt-in Prometheus endpoint and instruments validator connectivity, signing requests, backend operations, signing state, and key/build metadata. It also makes Ed25519 the effective default for file-backed consensus keys. Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "Add optional Prometheus metrics endpoint" | Re-trigger Greptile |
danbryan
force-pushed
the
metrics
branch
4 times, most recently
from
August 23, 2026 23:42
f169334 to
c60b617
Compare
Author
|
@greptileai review please |
danbryan
marked this pull request as ready for review
August 24, 2026 00:12
Serves /metrics from a metrics.listen config block: connection state and dial results, requests by type and result including double-sign refusals, sign latency, the persisted sign state, raw backend latency and errors, and build/key metadata, plus the standard Go and process collectors. Also defaults the file backend algorithm to ed25519 as documented.
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
Adds an opt-in Prometheus endpoint to the signer. A
metricsconfig blockenables an HTTP listener serving
GET /metricswith signer metrics plus thestandard Go and process collectors. Nothing changes when the block is absent:
collection is always on, serving is opt-in, and no existing behavior or config
is touched.
Also defaults the
filebackendalgorithmtoed25519, which the READMEand the
kms inittemplate already document as the default; before thischange a
backend: filekey without an explicitalgorithmfailed atstartup with
file: unknown key type.Motivation
A remote signer is the one component a validator cannot see from the chain
side until blocks are already being missed. Operators need to alert on the
signer itself: is it connected, is it signing, did the double-sign guard
refuse something, is the key backend healthy, and how fast is signing.
Metrics
A reasonable default set, based on surveying what the remote signers in the
ecosystem expose and what operators alert on. All series are prefixed
kms_,and signer series carry
chain_id, since one process can sign for severalchains. Full reference with starter alert rules is in
docs/metrics.md.kms_validator_connected,kms_validator_connected_since_timestamp_seconds,kms_validator_dials_total{result}kms_requests_total{type,result}whereresult="refused"marks a double-sign-guard decline,kms_sign_duration_seconds{type},kms_last_signed_height/_round/_timestamp_seconds{type}kms_sign_state_height/_round/_stepmirroring the persisted FilePV floorkms_backend_sign_duration_seconds{backend,algorithm},kms_backend_errors_total{backend,algorithm}; the pkcs11 and awskms backends put an HSM or a network API in the signing hot path, so this is where their health showskms_build_info{version,go_version},kms_key_info{chain_id,backend,algorithm,address}with the public consensus address, so operators can assert the signer holds the key they expectPlus the stock
go_*andprocess_*collectors frompromhttp.