Skip to content
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

feat: record validation and end-to-end response time in signer metrics #5664

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

hstove
Copy link
Contributor

@hstove hstove commented Jan 6, 2025

This PR adds two metrics:

  • stacks_signer_block_response_latencies_histogram: this measures the "end-to-end" time that the signer takes to respond to a block proposal. The block's timestamp is used as the "start time", so this isn't a totally fair end-to-end measurement, but it's directionally accurate.
  • stacks_signer_block_validation_latencies_histogram: the validation_time_ms reported by the node when validating a block proposal

@hstove hstove requested review from a team as code owners January 6, 2025 20:30
@hstove hstove requested a review from a team as a code owner January 6, 2025 20:31
@hstove hstove requested a review from jferrant January 6, 2025 20:32
@hstove hstove linked an issue Jan 7, 2025 that may be closed by this pull request
@aldur aldur requested review from jbencin and rdeioris January 8, 2025 15:56
Comment on lines +146 to +148
#[allow(unused_variables)]
pub fn record_block_validation_latency(latency_ms: u64) {
#[cfg(feature = "monitoring_prom")]
Copy link
Contributor

Choose a reason for hiding this comment

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

No strong preference here, but I've seen this pattern instead of allowing unused_variables:

pub fn record_block_validation_latency(latency_ms: u64) {
    #[cfg(not(feature = "monitoring_prom"))]
    let _ = latency_ms; // This prevents unused variable warnings

    #[cfg(feature = "monitoring_prom")]
    {
        ...
    }
}

Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

LGTM. I just left one optional comment. Feel free to ignore it.

Copy link
Contributor

@rdeioris rdeioris left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add signer prometheus metrics for block validation time
4 participants