Skip to content
Merged
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
13 changes: 11 additions & 2 deletions crates/pbs/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

use lazy_static::lazy_static;
use prometheus::{
register_histogram_vec_with_registry, register_int_counter_vec_with_registry, HistogramVec,
IntCounterVec, Registry,
register_histogram_vec_with_registry, register_int_counter_vec_with_registry,
register_int_gauge_vec_with_registry, HistogramVec, IntCounterVec, IntGaugeVec, Registry,
};

lazy_static! {
Expand All @@ -32,6 +32,15 @@ lazy_static! {
)
.unwrap();

/// Latest slot for which relay delivered a header
pub static ref RELAY_LAST_SLOT: IntGaugeVec = register_int_gauge_vec_with_registry!(
"relay_last_slot",
"Latest slot for which relay delivered a header",
&["relay_id"],
PBS_METRICS_REGISTRY
)
.unwrap();

// TO BEACON NODE
/// Status code returned to beacon node by endpoint
pub static ref BEACON_NODE_STATUS: IntCounterVec = register_int_counter_vec_with_registry!(
Expand Down
7 changes: 5 additions & 2 deletions crates/pbs/src/mev_boost/get_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use url::Url;

use crate::{
constants::{GET_HEADER_ENDPOINT_TAG, TIMEOUT_ERROR_CODE, TIMEOUT_ERROR_CODE_STR},
metrics::{RELAY_LATENCY, RELAY_STATUS_CODE},
metrics::{RELAY_LAST_SLOT, RELAY_LATENCY, RELAY_STATUS_CODE},
state::{BuilderApiState, PbsState},
};

Expand Down Expand Up @@ -79,7 +79,10 @@ pub async fn get_header<S: BuilderApiState>(
let relay_id = relays[i].id.as_ref();

match res {
Ok(Some(res)) => relay_bids.push(res),
Ok(Some(res)) => {
RELAY_LAST_SLOT.with_label_values(&[relay_id]).set(params.slot as i64);
relay_bids.push(res)
}
Ok(_) => {}
Err(err) if err.is_timeout() => error!(err = "Timed Out", relay_id),
Err(err) => error!(?err, relay_id),
Expand Down
106 changes: 92 additions & 14 deletions grafana/dashboards/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,94 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1,
"links": [],
"liveNow": true,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "cb_prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "red",
"mode": "thresholds"
},
"fieldMinMax": false,
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "yellow",
"value": null
},
{
"color": "green",
"value": 100
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 11,
"w": 6,
"x": 0,
"y": 0
},
"id": 61,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "cb_prometheus"
},
"disableTextWrap": false,
"editorMode": "code",
"exemplar": false,
"expr": "cb_pbs_relay_last_slot",
"format": "time_series",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "{{relay_id}}",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Last delivered slot",
"type": "stat"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
"y": 11
},
"id": 12,
"panels": [],
Expand Down Expand Up @@ -103,7 +181,7 @@
"h": 11,
"w": 6,
"x": 0,
"y": 1
"y": 12
},
"id": 11,
"options": {
Expand Down Expand Up @@ -202,7 +280,7 @@
"h": 11,
"w": 6,
"x": 6,
"y": 1
"y": 12
},
"id": 13,
"options": {
Expand Down Expand Up @@ -301,7 +379,7 @@
"h": 11,
"w": 6,
"x": 12,
"y": 1
"y": 12
},
"id": 43,
"options": {
Expand Down Expand Up @@ -400,7 +478,7 @@
"h": 11,
"w": 6,
"x": 18,
"y": 1
"y": 12
},
"id": 44,
"options": {
Expand Down Expand Up @@ -500,7 +578,7 @@
"h": 11,
"w": 6,
"x": 0,
"y": 12
"y": 23
},
"id": 20,
"options": {
Expand Down Expand Up @@ -604,7 +682,7 @@
"h": 11,
"w": 6,
"x": 6,
"y": 12
"y": 23
},
"id": 29,
"options": {
Expand Down Expand Up @@ -708,7 +786,7 @@
"h": 11,
"w": 6,
"x": 12,
"y": 12
"y": 23
},
"id": 30,
"options": {
Expand Down Expand Up @@ -767,6 +845,11 @@
"text": "All",
"value": "$__all"
},
{
"selected": false,
"text": "register_validator",
"value": "register_validator"
},
{
"selected": false,
"text": "get_header",
Expand All @@ -776,11 +859,6 @@
"selected": false,
"text": "submit_blinded_block",
"value": "submit_blinded_block"
},
{
"selected": false,
"text": "register_validator",
"value": "register_validator"
}
],
"query": "register_validator, get_header, submit_blinded_block",
Expand All @@ -798,6 +876,6 @@
"timezone": "browser",
"title": "PBS Metrics",
"uid": "cb_prometheus",
"version": 1,
"version": 2,
"weekStart": ""
}
Loading