Skip to content

Commit

Permalink
feat: add images
Browse files Browse the repository at this point in the history
  • Loading branch information
aimxhaisse committed Jun 21, 2024
1 parent 0fee9f9 commit ca28f9b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ The code is provided as-is with no warranties.
- Youtube video of [Ethereum Validator Watcher talk during EthCC[6]](https://www.youtube.com/watch?v=SkyncLrME1g&t=12s&ab_channel=%5BEthCC%5DLivestream2)
- Youtube video of [Ethereum Validator Watcher talk during EthStaker](https://www.youtube.com/watch?v=JrGz5FROgEg)

![overvliew-dashboard](docs/img/watcher-overview.png)
![breakdown-dashboard](docs/img/watcher-breakdown.png)

# Description

**Ethereum Validator Watcher** monitors the Ethereum beacon chain in
Expand Down Expand Up @@ -93,23 +96,27 @@ watched_keys:
labels: ["vc:validator-2", "region:rbx"]
```

In this example, we define 3 validator which are running on two
validator clients in different regions. The labels can be anything you
In this example, we define 3 validators which are running on two
validator clients in separate regions. The labels can be anything you
want as long as it follows the 'category:value' format. The breakdown
dashboard uses it to offer per-value comparisons within a
category. You can for instance compare your missed attestations
between region rbx and sbg, or between validator-1 and
validator-2. This comes handy when operating at scale, you can quickly
isolate where an issue comes from if your groups match your infrastructure.
isolate where an issue comes from if your groups match your
infrastructure.

Any set is possible, some plausible examples:

- by beacon instance (i.e: beacon:beacon-1)
- by client version (i.e: prysm:v5.0.3)
- by cluster (i.e: cluster:baremetal-1)
- by operator (i.e: operator:kiln)
- ...

By default, the watcher exports the `scope:watched` (keys present in
the configuration file), `scope:network` (entire network without the
keys in the configuration file) `scope:all-network` (entire network)
labels.

## Installation

Expand Down
Binary file removed docs/img/grafana_dashboard.png
Binary file not shown.
Binary file added docs/img/watcher-breakdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/watcher-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions eth_validator_watcher/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
SLOT_FOR_REWARDS_PROCESS = 17

# Default set of existing scopes.
LABEL_SCOPE_NETWORK="scope:network"
LABEL_SCOPE_ALL_NETWORK="scope:all-network"
LABEL_SCOPE_WATCHED="scope:watched"
LABEL_SCOPE_UNWATCHED="scope:all-network"
LABEL_SCOPE_NETWORK="scope:network"


def pct(a: int, b: int, inclusive: bool=False) -> float:
Expand Down
8 changes: 4 additions & 4 deletions eth_validator_watcher/watched_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from .config import Config, WatchedKeyConfig
from .models import Validators, ValidatorsLivenessResponse
from .utils import LABEL_SCOPE_NETWORK, LABEL_SCOPE_WATCHED, LABEL_SCOPE_UNWATCHED
from .utils import LABEL_SCOPE_ALL_NETWORK, LABEL_SCOPE_WATCHED, LABEL_SCOPE_NETWORK


def normalized_public_key(pubkey: str) -> str:
Expand All @@ -46,7 +46,7 @@ def __init__(self):
self.previous_status : Validators.DataItem.StatusEnum | None = None

# This gets overriden by process_config if the validator is watched.
self._labels : Optional[list[str]] = [LABEL_SCOPE_NETWORK, LABEL_SCOPE_UNWATCHED]
self._labels : Optional[list[str]] = [LABEL_SCOPE_ALL_NETWORK, LABEL_SCOPE_NETWORK]

# Gauges (updated each epoch) ; implies to use direct values
# on the Prometheus side (no rate calculation).
Expand Down Expand Up @@ -102,9 +102,9 @@ def process_config(self, config: WatchedKeyConfig):
config: New configuration
"""
if config.labels:
self._labels = config.labels + [LABEL_SCOPE_NETWORK, LABEL_SCOPE_WATCHED]
self._labels = config.labels + [LABEL_SCOPE_ALL_NETWORK, LABEL_SCOPE_WATCHED]
else:
self._labels = [LABEL_SCOPE_NETWORK, LABEL_SCOPE_UNWATCHED]
self._labels = [LABEL_SCOPE_ALL_NETWORK, LABEL_SCOPE_NETWORK]

def process_epoch(self, validator: Validators.DataItem):
"""Processes a new epoch.
Expand Down

0 comments on commit ca28f9b

Please sign in to comment.