Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add rejected blocks metric #6006

Closed
wants to merge 1 commit into from

Conversation

CodeSandwich
Copy link
Contributor

Adds a metric for blocks rejected from the import queue as invalid. Fixes #6005.

@parity-cla-bot
Copy link

It looks like @CodeSandwich signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@@ -175,6 +181,7 @@ impl<
"Stopping after #{} blocks because of an error",
link.imported_blocks,
);
rejected_blocks_number.fetch_add(1, Ordering::Relaxed);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you've confused the location here. This is the import-cli command. In this context we a) don't have metrics activated, nor are we sending them anywhere and b) fail immediately on the error, thus the number would always be 1 and never actually increase.

Copy link
Contributor

@gnunicorn gnunicorn left a comment

Choose a reason for hiding this comment

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

This isn't how we usually design the metrics. Rather than having them all on service, we track them as close to the source as possible and ideally already use prometheus measuring structs directly (they are more optimised).

For this case, that would mean we want to measure in primitives/consensus/common/src/import_queue/basic_queue with a generic u64 counter and register it from the service-metrics.

@gnunicorn
Copy link
Contributor

closed in favor of #6025 .

@gnunicorn gnunicorn closed this May 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add rejected blocks metric
3 participants