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

fix: Add metrics for reliably measuring Block Stream/Executor health #843

Merged
merged 7 commits into from
Jun 27, 2024

Conversation

morgsmccauley
Copy link
Collaborator

The current methods for determining both Block Stream and Executor health is flawed. This PR addresses these flaws by adding new, more reliable, metrics for use within Grafana.

Block Streams

A Block Stream is considered healthy if LAST_PROCESSED_BLOCK is continuously incremented, i.e. we are continuously downloading blocks from S3. This is flawed for the following reasons:

  1. When the Redis Stream if full, we halt the Block Stream, preventing it from processing more blocks
  2. When a Block Stream is intentionally stopped, we no longer process blocks

To address these flaws, I've introduced a new dedicated metric: BLOCK_STREAM_UP, which:

  • is incremented every time the Block Stream future is polled, i.e. the task is doing work. A static value means unhealthy.
  • is removed when the Block Stream is stopped, so that it doesn't trigger the false positive described above

Executors

An Executor is considered unhealthy if: it has messages in the Redis Stream, and no reported execution durations. The latter only being recorded on success. The inverse of this is used to determine "healthy". This is flawed for the following reasons:

  1. We distinguish the difference between a genuinely broken Indexer, and one broken due to system failures
  2. "health" is only determined when there are messages in Redis, meaning we catch the issue later than possible

To address these I have added the following metrics:

  1. EXECUTOR_UP which is incremented on every Executor loop, like above, a static value means unhealthy.
  2. SUCCESSFUL_EXECUTIONS/FAILED_EXECUTIONS which track successful/failed executions directly, rather than tracking using durations. This will be useful for tracking health of specific Indexers, e.g. the staking indexer should never have failed executions.

@morgsmccauley morgsmccauley requested a review from a team as a code owner June 27, 2024 05:24
@morgsmccauley morgsmccauley linked an issue Jun 27, 2024 that may be closed by this pull request
@morgsmccauley morgsmccauley merged commit adaadfc into main Jun 27, 2024
11 checks passed
@morgsmccauley morgsmccauley deleted the fix/stop-alerts branch June 27, 2024 20:48
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.

Stopped Block Stream/Executor Alerts incorrectly fire
1 participant