Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,25 @@ container. Port 0 takes a free port. elo logs the address in a `metrics` line be
| Metric | Type | Value |
| --- | --- | --- |
| `elo_header_tip_height` | gauge | The height of the tip of the header chain |
| `elo_header_tip_work` | gauge | The work of the chain up to the tip, in decimal |
| `elo_header_tip_work` | gauge | The work of the chain up to the tip, in decimal with all its digits. Prometheus keeps each value as a 64-bit float, so it rounds a work above 2^53 |
| `elo_peer_state` | gauge | 1 for the step of the connection, and 0 for each other. The `state` label is `dial`, `sync`, `synced` or `wait` |
| `elo_reconnects_total` | counter | The connections that ended, and that elo dials again after the wait |
| `elo_reconnects_total` | counter | Each failed lookup, dial or handshake and each connection that ended, after which elo waits and dials again |
| `elo_peer_received_messages_total` | counter | The messages from the peer, for each command. The `command` label is `version`, `verack`, `ping`, `pong`, `getheaders`, `headers`, `wtxidrelay`, `sendaddrv2`, `sendheaders`, `inv`, or `other` for each other command |
| `elo_peer_received_bytes_total` | counter | The bytes of the messages from the peer, with their headers, for each command |
| `elo_peer_sent_messages_total` | counter | The messages to the peer, for each command |
| `elo_peer_sent_bytes_total` | counter | The bytes of the messages to the peer, with their headers, for each command |
| `elo_metrics_failures_total` | counter | The connections to the metrics that failed. The `kind` label is `accept` for an accept error, `io` for a read or write error, `timeout` for no answer in 1 s, or `evicted` for 8 newer connections before the answer |

The tip moves when the `tip` line does: at the end of a sync, and then with each new tip. As for the
log, the names are an interface, and `src/metrics.rs` holds them. elo accepts each connection when
it comes and answers at most 8 at the same time, each in at most 1 s. It closes each connection after
its answer, and also closes a connection when 8 newer connections come before its answer, so idle
clients cannot hold a scrape. A scrape gets its answer in at most 1 s, unless 8 newer connections
come before its answer. The scrape timeout of Prometheus is 10 s by default. A request
head is at most 8 KiB. Another path gets 404, and another method gets 405.
The tip moves when the `tip` line does: at the end of a sync, and then with each new tip. A received
message counts when elo has all of its frame and the frame is valid, and a sent message counts when
its write ends. The four counters of the messages have the same `command` values, also for the
commands that elo does not send. They count each connection, and do not go back to 0 at a reconnect.
As for the log, the names are an interface, and `src/metrics.rs` holds them. elo accepts each
connection when it comes and answers at most 8 at the same time, each in at most 1 s. It closes each
connection after its answer, and also closes a connection when 8 newer connections come before its
answer, so idle clients cannot hold a scrape. A scrape gets its answer in at most 1 s, unless 8
newer connections come before its answer. The scrape timeout of Prometheus is 10 s by default. A
request head is at most 8 KiB. Another path gets 404, and another method gets 405.

## Build

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ async fn dial(
chain: &mut elo::chain::Chain,
metrics: &elo::metrics::Metrics,
) -> Result<End, std::io::Error> {
let (connection, version) = match elo::net::handshake(destination, chain).await {
let (connection, version) = match elo::net::handshake(destination, chain, metrics).await {
Ok(handshake) => handshake,
Err(error) => return Ok(End::Handshake(error)),
};
Expand Down
Loading