diff --git a/.dockerignore b/.dockerignore index 36451011..8c6bdbde 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,4 @@ target Dockerfile .dockerignore -.git .gitignore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68186c23..0692b1ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,11 @@ jobs: uses: actions/checkout@v4 with: ref: "stable" + fetch-depth: 0 + + - name: Log commit hash + run: | + echo "Releasing commit: $(git rev-parse HEAD)" - name: Cache Cargo registry uses: actions/cache@v3 @@ -107,6 +112,7 @@ jobs: uses: actions/checkout@v4 with: ref: "stable" + fetch-depth: 0 - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -141,6 +147,7 @@ jobs: uses: actions/checkout@v4 with: ref: "stable" + fetch-depth: 0 - name: Set up QEMU uses: docker/setup-qemu-action@v3 diff --git a/bin/pbs.rs b/bin/pbs.rs index 1514cf10..cb47ceb6 100644 --- a/bin/pbs.rs +++ b/bin/pbs.rs @@ -18,8 +18,8 @@ async fn main() -> Result<()> { let pbs_config = load_pbs_config().await?; + PbsService::init_metrics(pbs_config.chain)?; let state = PbsState::new(pbs_config); - PbsService::init_metrics()?; let server = PbsService::run::<_, DefaultBuilderApi>(state); tokio::select! { diff --git a/bin/src/lib.rs b/bin/src/lib.rs index e4f566b2..c280d2a1 100644 --- a/bin/src/lib.rs +++ b/bin/src/lib.rs @@ -11,6 +11,7 @@ pub mod prelude { }, pbs::{BuilderEvent, BuilderEventClient, OnBuilderApiEvent}, signer::{BlsPublicKey, BlsSignature, EcdsaPublicKey, EcdsaSignature}, + types::Chain, utils::{ initialize_pbs_tracing_log, initialize_tracing_log, utcnow_ms, utcnow_ns, utcnow_sec, utcnow_us, diff --git a/crates/common/build.rs b/crates/common/build.rs new file mode 100644 index 00000000..9bd10ecb --- /dev/null +++ b/crates/common/build.rs @@ -0,0 +1,7 @@ +use std::process::Command; + +fn main() { + let output = Command::new("git").args(["rev-parse", "HEAD"]).output().unwrap(); + let git_hash = String::from_utf8(output.stdout).unwrap(); + println!("cargo:rustc-env=GIT_HASH={git_hash}"); +} diff --git a/crates/common/src/constants.rs b/crates/common/src/constants.rs index 44b17e1a..d03904b3 100644 --- a/crates/common/src/constants.rs +++ b/crates/common/src/constants.rs @@ -2,3 +2,4 @@ pub const APPLICATION_BUILDER_DOMAIN: [u8; 4] = [0, 0, 0, 1]; pub const GENESIS_VALIDATORS_ROOT: [u8; 32] = [0; 32]; pub const COMMIT_BOOST_DOMAIN: [u8; 4] = [109, 109, 111, 67]; pub const COMMIT_BOOST_VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const COMMIT_BOOST_COMMIT: &str = env!("GIT_HASH"); diff --git a/crates/common/src/types.rs b/crates/common/src/types.rs index f6b5efd1..71656178 100644 --- a/crates/common/src/types.rs +++ b/crates/common/src/types.rs @@ -28,6 +28,15 @@ pub enum Chain { pub type ForkVersion = [u8; 4]; +impl std::fmt::Display for Chain { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Mainnet | Self::Holesky | Self::Sepolia | Self::Helder => write!(f, "{self:?}"), + Self::Custom { .. } => write!(f, "Custom"), + } + } +} + impl std::fmt::Debug for Chain { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { diff --git a/crates/metrics/src/provider.rs b/crates/metrics/src/provider.rs index 97b2d063..b1cd242a 100644 --- a/crates/metrics/src/provider.rs +++ b/crates/metrics/src/provider.rs @@ -7,28 +7,33 @@ use axum::{ response::{IntoResponse, Response}, routing::get, }; -use cb_common::config::ModuleMetricsConfig; +use cb_common::{ + config::ModuleMetricsConfig, + constants::{COMMIT_BOOST_COMMIT, COMMIT_BOOST_VERSION}, + types::Chain, +}; use eyre::bail; -use prometheus::{Encoder, Registry, TextEncoder}; +use prometheus::{Encoder, IntGauge, Opts, Registry, TextEncoder}; use tokio::net::TcpListener; use tracing::{error, info, trace, warn}; pub struct MetricsProvider { + network: Chain, config: ModuleMetricsConfig, registry: Registry, } impl MetricsProvider { - pub fn new(config: ModuleMetricsConfig, registry: Registry) -> Self { - MetricsProvider { config, registry } + pub fn new(network: Chain, config: ModuleMetricsConfig, registry: Registry) -> Self { + MetricsProvider { network, config, registry } } - pub fn from_registry(registry: Registry) -> eyre::Result> { - Ok(ModuleMetricsConfig::load_from_env()?.map(|config| MetricsProvider { config, registry })) + pub fn from_registry(network: Chain, registry: Registry) -> eyre::Result> { + Ok(ModuleMetricsConfig::load_from_env()?.map(|config| Self::new(network, config, registry))) } - pub fn load_and_run(registry: Registry) -> eyre::Result<()> { - if let Some(provider) = MetricsProvider::from_registry(registry)? { + pub fn load_and_run(network: Chain, registry: Registry) -> eyre::Result<()> { + if let Some(provider) = MetricsProvider::from_registry(network, registry)? { tokio::spawn(async move { if let Err(err) = provider.run().await { error!("Metrics server error: {:?}", err); @@ -44,6 +49,15 @@ impl MetricsProvider { pub async fn run(self) -> eyre::Result<()> { info!("Starting metrics server on port {}", self.config.server_port); + let opts = Opts::new("info", "Commit Boost info") + .const_label("version", COMMIT_BOOST_VERSION) + .const_label("commit", COMMIT_BOOST_COMMIT) + .const_label("network", self.network.to_string()); + let info = IntGauge::with_opts(opts).unwrap(); + info.set(1); + + self.registry.register(Box::new(info)).unwrap(); + let router = axum::Router::new() .route("/metrics", get(handle_metrics)) .route("/status", get(handle_status)) diff --git a/crates/pbs/src/service.rs b/crates/pbs/src/service.rs index 2533573b..8cc5d5bb 100644 --- a/crates/pbs/src/service.rs +++ b/crates/pbs/src/service.rs @@ -1,8 +1,9 @@ use std::time::Duration; use cb_common::{ - constants::COMMIT_BOOST_VERSION, + constants::{COMMIT_BOOST_COMMIT, COMMIT_BOOST_VERSION}, pbs::{BUILDER_API_PATH, GET_STATUS_PATH}, + types::Chain, }; use cb_metrics::provider::MetricsProvider; use eyre::{bail, Context, Result}; @@ -25,7 +26,7 @@ impl PbsService { let addr = state.config.endpoint; let events_subs = state.config.event_publisher.as_ref().map(|e| e.n_subscribers()).unwrap_or_default(); - info!(version = COMMIT_BOOST_VERSION, ?addr, events_subs, chain =? state.config.chain, "starting PBS service"); + info!(version = COMMIT_BOOST_VERSION, commit = COMMIT_BOOST_COMMIT, ?addr, events_subs, chain =? state.config.chain, "starting PBS service"); let app = create_app_router::(state); let listener = TcpListener::bind(addr).await?; @@ -52,7 +53,7 @@ impl PbsService { PBS_METRICS_REGISTRY.register(c).expect("failed to register metric"); } - pub fn init_metrics() -> Result<()> { - MetricsProvider::load_and_run(PBS_METRICS_REGISTRY.clone()) + pub fn init_metrics(network: Chain) -> Result<()> { + MetricsProvider::load_and_run(network, PBS_METRICS_REGISTRY.clone()) } } diff --git a/crates/signer/src/service.rs b/crates/signer/src/service.rs index 228158e9..c32e673c 100644 --- a/crates/signer/src/service.rs +++ b/crates/signer/src/service.rs @@ -21,8 +21,8 @@ use cb_common::{ }, }, config::StartSignerConfig, - constants::COMMIT_BOOST_VERSION, - types::{Jwt, ModuleId}, + constants::{COMMIT_BOOST_COMMIT, COMMIT_BOOST_VERSION}, + types::{Chain, Jwt, ModuleId}, }; use cb_metrics::provider::MetricsProvider; use eyre::{Context, Result}; @@ -74,10 +74,10 @@ impl SigningService { let proxies = manager.proxies(); let loaded_proxies = proxies.bls_signers.len() + proxies.ecdsa_signers.len(); - info!(version = COMMIT_BOOST_VERSION, modules =? module_ids, port =? config.server_port, loaded_consensus, loaded_proxies, "Starting signing service"); + info!(version = COMMIT_BOOST_VERSION, commit = COMMIT_BOOST_COMMIT, modules =? module_ids, port =? config.server_port, loaded_consensus, loaded_proxies, "Starting signing service"); let state = SigningState { manager: RwLock::new(manager).into(), jwts: config.jwts.into() }; - SigningService::init_metrics()?; + SigningService::init_metrics(config.chain)?; let app = axum::Router::new() .route(REQUEST_SIGNATURE_PATH, post(handle_request_signature)) @@ -96,8 +96,8 @@ impl SigningService { .wrap_err("signer server exited") } - fn init_metrics() -> Result<()> { - MetricsProvider::load_and_run(SIGNER_METRICS_REGISTRY.clone()) + fn init_metrics(network: Chain) -> Result<()> { + MetricsProvider::load_and_run(network, SIGNER_METRICS_REGISTRY.clone()) } } diff --git a/examples/configs/pbs_metrics.toml b/examples/configs/pbs_metrics.toml index 45683f3a..b8013c15 100644 --- a/examples/configs/pbs_metrics.toml +++ b/examples/configs/pbs_metrics.toml @@ -10,9 +10,10 @@ id = "example-relay" url = "http://0xa1cec75a3f0661e99299274182938151e8433c61a19222347ea1313d839229cb4ce4e3e5aa2bdeb71c8fcf1b084963c2@abc.xyz" [metrics] -prometheus_config = "./docker/prometheus.yml" +prometheus_config = "./provisioning/prometheus.yml" use_grafana = true use_cadvisor = false +grafana_path = "./provisioning/grafana" [logs] log_dir_path = "./logs" diff --git a/examples/da_commit/src/main.rs b/examples/da_commit/src/main.rs index 88767f00..ebcc27b2 100644 --- a/examples/da_commit/src/main.rs +++ b/examples/da_commit/src/main.rs @@ -105,12 +105,13 @@ async fn main() -> Result<()> { // Remember to register all your metrics before starting the process MY_CUSTOM_REGISTRY.register(Box::new(SIG_RECEIVED_COUNTER.clone()))?; // Spin up a server that exposes the /metrics endpoint to Prometheus - MetricsProvider::load_and_run(MY_CUSTOM_REGISTRY.clone())?; match load_commit_module_config::() { Ok(config) => { let _guard = initialize_tracing_log(&config.id)?; + MetricsProvider::load_and_run(config.chain, MY_CUSTOM_REGISTRY.clone())?; + info!( module_id = %config.id, sleep_secs = config.extra.sleep_secs, diff --git a/examples/status_api/src/main.rs b/examples/status_api/src/main.rs index 40bed730..483beefc 100644 --- a/examples/status_api/src/main.rs +++ b/examples/status_api/src/main.rs @@ -82,13 +82,14 @@ async fn main() -> Result<()> { color_eyre::install()?; let (pbs_config, extra) = load_pbs_custom_config::().await?; + let chain = pbs_config.chain; let _guard = initialize_pbs_tracing_log()?; let custom_state = MyBuilderState::from_config(extra); let state = PbsState::new(pbs_config).with_data(custom_state); PbsService::register_metric(Box::new(CHECK_RECEIVED_COUNTER.clone())); - PbsService::init_metrics()?; + PbsService::init_metrics(chain)?; PbsService::run::(state).await } diff --git a/provisioning/grafana/dashboards/pbs_dashboard.json b/provisioning/grafana/dashboards/pbs_dashboard.json index 94dd0626..0a9659a3 100644 --- a/provisioning/grafana/dashboards/pbs_dashboard.json +++ b/provisioning/grafana/dashboards/pbs_dashboard.json @@ -1,32 +1,4 @@ { - "__inputs": [], - "__elements": {}, - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "11.1.0" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "stat", - "name": "Stat", - "version": "" - }, - { - "type": "panel", - "id": "timeseries", - "name": "Time series", - "version": "" - } - ], "annotations": { "list": [ { @@ -50,6 +22,113 @@ "links": [], "liveNow": true, "panels": [ + { + "datasource": { + "uid": "cb_prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 79, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/.*/", + "values": false + }, + "showPercentChange": false, + "text": { + "titleSize": 25 + }, + "textMode": "value_and_name", + "wideLayout": true + }, + "pluginVersion": "11.3.1", + "targets": [ + { + "editorMode": "code", + "expr": "cb_pbs_info", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Info", + "transformations": [ + { + "id": "reduce", + "options": { + "includeTimeField": false, + "labelsToFields": true, + "mode": "seriesToRows", + "reducers": [ + "lastNotNull" + ] + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Field": true, + "Last *": true, + "__name__": true, + "instance": true, + "job": true + }, + "includeByName": {}, + "indexByName": { + "Field": 0, + "Last *": 7, + "__name__": 1, + "commit": 4, + "instance": 5, + "job": 6, + "network": 2, + "version": 3 + }, + "renameByName": { + "commit": "Commit hash", + "network": "Network", + "version": "Version" + } + } + } + ], + "type": "stat" + }, { "datasource": { "type": "prometheus", @@ -83,7 +162,7 @@ "h": 11, "w": 6, "x": 0, - "y": 0 + "y": 6 }, "id": 61, "options": { @@ -103,7 +182,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.1.0", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -158,7 +237,7 @@ "h": 11, "w": 6, "x": 6, - "y": 0 + "y": 6 }, "id": 78, "options": { @@ -178,7 +257,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.1.0", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -208,12 +287,11 @@ "h": 1, "w": 24, "x": 0, - "y": 11 + "y": 17 }, "id": 12, "panels": [], "repeat": "endpoint", - "repeatDirection": "h", "title": "$endpoint calls", "type": "row" }, @@ -234,6 +312,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -284,7 +363,7 @@ "h": 11, "w": 6, "x": 0, - "y": 12 + "y": 18 }, "id": 11, "options": { @@ -299,6 +378,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -333,6 +413,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -383,7 +464,7 @@ "h": 11, "w": 6, "x": 6, - "y": 12 + "y": 18 }, "id": 13, "options": { @@ -398,6 +479,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -432,6 +514,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -482,7 +565,7 @@ "h": 11, "w": 6, "x": 12, - "y": 12 + "y": 18 }, "id": 43, "options": { @@ -497,6 +580,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -531,6 +615,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -581,7 +666,7 @@ "h": 11, "w": 6, "x": 18, - "y": 12 + "y": 18 }, "id": 44, "options": { @@ -596,6 +681,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -630,6 +716,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -681,7 +768,7 @@ "h": 11, "w": 6, "x": 0, - "y": 23 + "y": 29 }, "id": 20, "options": { @@ -696,6 +783,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -734,6 +822,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -785,7 +874,7 @@ "h": 11, "w": 6, "x": 6, - "y": 23 + "y": 29 }, "id": 29, "options": { @@ -800,6 +889,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -838,6 +928,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -889,7 +980,7 @@ "h": 11, "w": 6, "x": 12, - "y": 23 + "y": 29 }, "id": 30, "options": { @@ -904,6 +995,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -926,28 +1018,21 @@ "type": "timeseries" } ], + "preload": false, "refresh": "5m", - "schemaVersion": 39, + "schemaVersion": 40, "tags": [], "templating": { "list": [ { "current": { - "selected": false, - "text": "All", + "text": "$__all", "value": "$__all" }, "description": "BuilderAPI endpoint", - "hide": 0, "includeAll": true, - "multi": false, "name": "endpoint", "options": [ - { - "selected": true, - "text": "All", - "value": "$__all" - }, { "selected": false, "text": "register_validator", @@ -965,8 +1050,6 @@ } ], "query": "register_validator, get_header, submit_blinded_block", - "queryValue": "", - "skipUrlSync": false, "type": "custom" } ] @@ -979,6 +1062,6 @@ "timezone": "browser", "title": "PBS Metrics", "uid": "cb_pbs_metrics", - "version": 1, + "version": 4, "weekStart": "" } \ No newline at end of file diff --git a/provisioning/grafana/dashboards/signer_dashboard.json b/provisioning/grafana/dashboards/signer_dashboard.json index 01e93973..ed36955f 100644 --- a/provisioning/grafana/dashboards/signer_dashboard.json +++ b/provisioning/grafana/dashboards/signer_dashboard.json @@ -1,32 +1,4 @@ { - "__inputs": [], - "__elements": {}, - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "11.1.0" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "stat", - "name": "Stat", - "version": "" - }, - { - "type": "panel", - "id": "timeseries", - "name": "Time series", - "version": "" - } - ], "annotations": { "list": [ { @@ -50,6 +22,113 @@ "links": [], "liveNow": true, "panels": [ + { + "datasource": { + "uid": "cb_prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 79, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/.*/", + "values": false + }, + "showPercentChange": false, + "text": { + "titleSize": 25 + }, + "textMode": "value_and_name", + "wideLayout": true + }, + "pluginVersion": "11.3.1", + "targets": [ + { + "editorMode": "code", + "expr": "cb_signer_info", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Info", + "transformations": [ + { + "id": "reduce", + "options": { + "includeTimeField": false, + "labelsToFields": true, + "mode": "seriesToRows", + "reducers": [ + "lastNotNull" + ] + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Field": true, + "Last *": true, + "__name__": true, + "instance": true, + "job": true + }, + "includeByName": {}, + "indexByName": { + "Field": 0, + "Last *": 7, + "__name__": 1, + "commit": 4, + "instance": 5, + "job": 6, + "network": 2, + "version": 3 + }, + "renameByName": { + "commit": "Commit hash", + "network": "Network", + "version": "Version" + } + } + } + ], + "type": "stat" + }, { "datasource": { "type": "prometheus", @@ -79,7 +158,7 @@ "h": 6, "w": 6, "x": 0, - "y": 0 + "y": 6 }, "id": 21, "options": { @@ -89,7 +168,9 @@ "orientation": "horizontal", "percentChangeColorMode": "standard", "reduceOptions": { - "calcs": ["lastNotNull"], + "calcs": [ + "lastNotNull" + ], "fields": "", "values": false }, @@ -97,7 +178,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.1.0", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -149,7 +230,7 @@ "h": 6, "w": 6, "x": 6, - "y": 0 + "y": 6 }, "id": 22, "options": { @@ -159,7 +240,9 @@ "orientation": "horizontal", "percentChangeColorMode": "standard", "reduceOptions": { - "calcs": ["lastNotNull"], + "calcs": [ + "lastNotNull" + ], "fields": "", "values": false }, @@ -167,7 +250,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.1.0", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -196,12 +279,11 @@ "h": 1, "w": 24, "x": 0, - "y": 11 + "y": 12 }, "id": 23, "panels": [], "repeat": "endpoint", - "repeatDirection": "h", "title": "$endpoint calls", "type": "row" }, @@ -222,6 +304,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -272,7 +355,7 @@ "h": 11, "w": 12, "x": 0, - "y": 12 + "y": 13 }, "id": 24, "options": { @@ -287,6 +370,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -321,6 +405,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -371,7 +456,7 @@ "h": 11, "w": 12, "x": 12, - "y": 12 + "y": 13 }, "id": 25, "options": { @@ -386,6 +471,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -404,47 +490,38 @@ "type": "timeseries" } ], + "preload": false, "refresh": "5m", - "schemaVersion": 39, + "schemaVersion": 40, "tags": [], "templating": { "list": [ { "current": { - "selected": false, - "text": "All", + "text": "$__all", "value": "$__all" }, "description": "SignerAPI endpoint", - "hide": 0, "includeAll": true, - "multi": false, "name": "endpoint", "options": [ - { - "selected": true, - "text": "All", - "value": "$__all" - }, { "selected": false, - "text": "Get Pubkeys", + "text": "get_pubkeys", "value": "get_pubkeys" }, { "selected": false, - "text": "Generate Proxy Keys", + "text": "generate_proxy_key", "value": "generate_proxy_key" }, { "selected": false, - "text": "Request Signature", + "text": "request_signature", "value": "request_signature" } ], "query": "get_pubkeys, generate_proxy_key, request_signature", - "queryValue": "", - "skipUrlSync": false, "type": "custom" } ] @@ -457,6 +534,6 @@ "timezone": "browser", "title": "Signer Metrics", "uid": "cb_signer_metrics", - "version": 1, + "version": 2, "weekStart": "" -} +} \ No newline at end of file diff --git a/provisioning/grafana/pbs_public_dashboard.json b/provisioning/grafana/pbs_public_dashboard.json index d7106639..578e2382 100644 --- a/provisioning/grafana/pbs_public_dashboard.json +++ b/provisioning/grafana/pbs_public_dashboard.json @@ -15,7 +15,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "11.1.0" + "version": "11.3.1" }, { "type": "datasource", @@ -59,6 +59,118 @@ "links": [], "liveNow": true, "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_CB_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 79, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/.*/", + "values": false + }, + "showPercentChange": false, + "text": { + "titleSize": 25 + }, + "textMode": "value_and_name", + "wideLayout": true + }, + "pluginVersion": "11.3.1", + "targets": [ + { + "editorMode": "code", + "expr": "cb_pbs_info", + "legendFormat": "__auto", + "range": true, + "refId": "A", + "datasource": { + "type": "prometheus", + "uid": "${DS_CB_PROMETHEUS}" + } + } + ], + "title": "Info", + "transformations": [ + { + "id": "reduce", + "options": { + "includeTimeField": false, + "labelsToFields": true, + "mode": "seriesToRows", + "reducers": [ + "lastNotNull" + ] + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Field": true, + "Last *": true, + "__name__": true, + "instance": true, + "job": true + }, + "includeByName": {}, + "indexByName": { + "Field": 0, + "Last *": 7, + "__name__": 1, + "commit": 4, + "instance": 5, + "job": 6, + "network": 2, + "version": 3 + }, + "renameByName": { + "commit": "Commit hash", + "network": "Network", + "version": "Version" + } + } + } + ], + "type": "stat" + }, { "datasource": { "type": "prometheus", @@ -92,7 +204,7 @@ "h": 11, "w": 6, "x": 0, - "y": 0 + "y": 6 }, "id": 61, "options": { @@ -112,7 +224,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.1.0", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -167,7 +279,7 @@ "h": 11, "w": 6, "x": 6, - "y": 0 + "y": 6 }, "id": 78, "options": { @@ -187,7 +299,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.1.0", + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -217,12 +329,11 @@ "h": 1, "w": 24, "x": 0, - "y": 11 + "y": 17 }, "id": 12, "panels": [], "repeat": "endpoint", - "repeatDirection": "h", "title": "$endpoint calls", "type": "row" }, @@ -243,6 +354,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -293,7 +405,7 @@ "h": 11, "w": 6, "x": 0, - "y": 12 + "y": 18 }, "id": 11, "options": { @@ -308,6 +420,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -342,6 +455,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -392,7 +506,7 @@ "h": 11, "w": 6, "x": 6, - "y": 12 + "y": 18 }, "id": 13, "options": { @@ -407,6 +521,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -441,6 +556,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -491,7 +607,7 @@ "h": 11, "w": 6, "x": 12, - "y": 12 + "y": 18 }, "id": 43, "options": { @@ -506,6 +622,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -540,6 +657,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -590,7 +708,7 @@ "h": 11, "w": 6, "x": 18, - "y": 12 + "y": 18 }, "id": 44, "options": { @@ -605,6 +723,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -639,6 +758,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -690,7 +810,7 @@ "h": 11, "w": 6, "x": 0, - "y": 23 + "y": 29 }, "id": 20, "options": { @@ -705,6 +825,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -743,6 +864,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -794,7 +916,7 @@ "h": 11, "w": 6, "x": 6, - "y": 23 + "y": 29 }, "id": 29, "options": { @@ -809,6 +931,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -847,6 +970,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -898,7 +1022,7 @@ "h": 11, "w": 6, "x": 12, - "y": 23 + "y": 29 }, "id": 30, "options": { @@ -913,6 +1037,7 @@ "sort": "none" } }, + "pluginVersion": "11.3.1", "targets": [ { "datasource": { @@ -936,27 +1061,19 @@ } ], "refresh": "5m", - "schemaVersion": 39, + "schemaVersion": 40, "tags": [], "templating": { "list": [ { "current": { - "selected": false, - "text": "All", + "text": "$__all", "value": "$__all" }, "description": "BuilderAPI endpoint", - "hide": 0, "includeAll": true, - "multi": false, "name": "endpoint", "options": [ - { - "selected": true, - "text": "All", - "value": "$__all" - }, { "selected": false, "text": "register_validator", @@ -974,8 +1091,6 @@ } ], "query": "register_validator, get_header, submit_blinded_block", - "queryValue": "", - "skipUrlSync": false, "type": "custom" } ] @@ -988,6 +1103,6 @@ "timezone": "browser", "title": "PBS Metrics", "uid": "cb_pbs_metrics", - "version": 1, + "version": 4, "weekStart": "" } \ No newline at end of file diff --git a/provisioning/grafana/signer_public_dashboard.json b/provisioning/grafana/signer_public_dashboard.json index 3077ad6f..c6805cb4 100644 --- a/provisioning/grafana/signer_public_dashboard.json +++ b/provisioning/grafana/signer_public_dashboard.json @@ -59,6 +59,118 @@ "links": [], "liveNow": true, "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_CB_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 79, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/.*/", + "values": false + }, + "showPercentChange": false, + "text": { + "titleSize": 25 + }, + "textMode": "value_and_name", + "wideLayout": true + }, + "pluginVersion": "11.3.1", + "targets": [ + { + "editorMode": "code", + "expr": "cb_signer_info", + "legendFormat": "__auto", + "range": true, + "refId": "A", + "datasource": { + "type": "prometheus", + "uid": "${DS_CB_PROMETHEUS}" + } + } + ], + "title": "Info", + "transformations": [ + { + "id": "reduce", + "options": { + "includeTimeField": false, + "labelsToFields": true, + "mode": "seriesToRows", + "reducers": [ + "lastNotNull" + ] + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Field": true, + "Last *": true, + "__name__": true, + "instance": true, + "job": true + }, + "includeByName": {}, + "indexByName": { + "Field": 0, + "Last *": 7, + "__name__": 1, + "commit": 4, + "instance": 5, + "job": 6, + "network": 2, + "version": 3 + }, + "renameByName": { + "commit": "Commit hash", + "network": "Network", + "version": "Version" + } + } + } + ], + "type": "stat" + }, { "datasource": { "type": "prometheus", @@ -88,7 +200,7 @@ "h": 6, "w": 6, "x": 0, - "y": 0 + "y": 6 }, "id": 21, "options": { @@ -160,7 +272,7 @@ "h": 6, "w": 6, "x": 6, - "y": 0 + "y": 6 }, "id": 22, "options": { @@ -209,7 +321,7 @@ "h": 1, "w": 24, "x": 0, - "y": 6 + "y": 12 }, "id": 23, "panels": [], @@ -285,7 +397,7 @@ "h": 11, "w": 12, "x": 0, - "y": 7 + "y": 13 }, "id": 24, "options": { @@ -386,7 +498,7 @@ "h": 11, "w": 12, "x": 12, - "y": 7 + "y": 13 }, "id": 25, "options": { @@ -463,6 +575,6 @@ "timezone": "browser", "title": "Signer Metrics", "uid": "cb_signer_metrics", - "version": 1, + "version": 2, "weekStart": "" } \ No newline at end of file diff --git a/provisioning/pbs.Dockerfile b/provisioning/pbs.Dockerfile index 9d2a2fcf..95568b9d 100644 --- a/provisioning/pbs.Dockerfile +++ b/provisioning/pbs.Dockerfile @@ -1,4 +1,4 @@ -FROM lukemathwalker/cargo-chef:0.1.68-rust-bookworm AS chef +FROM lukemathwalker/cargo-chef:latest-rust-1.83 AS chef WORKDIR /app FROM chef AS planner diff --git a/provisioning/signer.Dockerfile b/provisioning/signer.Dockerfile index 3f267806..51c192af 100644 --- a/provisioning/signer.Dockerfile +++ b/provisioning/signer.Dockerfile @@ -1,4 +1,4 @@ -FROM lukemathwalker/cargo-chef:0.1.68-rust-bookworm AS chef +FROM lukemathwalker/cargo-chef:latest-rust-1.83 AS chef WORKDIR /app FROM chef AS planner