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(metrics): add metrics in chain-listener [NET-806] #2208

Merged
merged 5 commits into from
Apr 3, 2024

Conversation

kmd-fl
Copy link
Contributor

@kmd-fl kmd-fl commented Mar 28, 2024

Description

Add some metrics to the ChainListener module.

Proposed Changes

Add a pack of metrics:

pub struct ChainListenerMetrics {
    // how many request Nox sends to ccp
    ccp_requests_total: Counter,
    // how many success replies Nox receives from ccp
    // an error is either error from ccp or connection errors
    ccp_replies_total: Counter,
    // how long we wait for a reply from ccp
    ccp_request_duration_msec: Histogram,
    // how many proofs we submitted
    cpp_proofs_submitted: Counter,
    // how many proofs we failed to submit
    cpp_proofs_submit_failed: Counter,
    // how many proofs transaction are ok
    ccp_proofs_tx_success: Counter,
    // how many proofs transaction are failed
    ccp_proofs_tx_failed: CounterWithExemplar<TxLabel>,
    // How many blocks we have received from the newHead subscription
    blocks_seen: CounterWithExemplar<BlockLabel>,
    // How many block we manage to process while processing the block
    blocks_processed: Counter,
}

Additional Notes

We were discussing some refactoring, and I did the tiniest amount of refactoring, but I think we should do it in a separate PR.

Copy link

linear bot commented Mar 28, 2024

Copy link
Member

@justprosh justprosh left a comment

Choose a reason for hiding this comment

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

Overall very cool! Thx very much for explanatory comments 🙏🙏🙏

@kmd-fl kmd-fl added the e2e Run e2e workflow label Apr 2, 2024
@kmd-fl kmd-fl enabled auto-merge (squash) April 2, 2024 14:55
@kmd-fl kmd-fl merged commit 3f17b11 into master Apr 3, 2024
14 checks passed
@kmd-fl kmd-fl deleted the chain-listener-metrics branch April 3, 2024 06:47
Copy link
Member

@folex folex left a comment

Choose a reason for hiding this comment

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

nice!

// how many proofs transaction are failed
ccp_proofs_tx_failed: CounterWithExemplar<TxLabel>,
// How many blocks we have received from the newHead subscription
blocks_seen: CounterWithExemplar<BlockLabel>,
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be a gauge with a block number?

// How many blocks we have received from the newHead subscription
blocks_seen: CounterWithExemplar<BlockLabel>,
// How many block we manage to process while processing the block
blocks_processed: Counter,
Copy link
Member

Choose a reason for hiding this comment

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

and this, too

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

Successfully merging this pull request may close these issues.

None yet

4 participants