Skip to content

Commit 978418b

Browse files
authored
*: cherry picking blinded metric (#4129)
Cherry-picking #4117 for `v1.7.2` category: misc ticket: none
1 parent 749d2d7 commit 978418b

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

core/fetcher/fetcher.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,13 @@ func (f *Fetcher) fetchProposerData(ctx context.Context, slot uint64, defSet cor
302302
return nil, errors.Wrap(err, "new proposal")
303303
}
304304

305+
// Track whether the fetched proposal is blinded (built by MEV builder, 1) or local (built by beacon node, 0)
306+
var blinded float64
307+
if proposal.Blinded {
308+
blinded = 1
309+
}
310+
proposalBlindedGauge.Set(blinded)
311+
305312
resp[pubkey] = coreProposal
306313
}
307314

core/fetcher/metrics.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright © 2022-2025 Obol Labs Inc. Licensed under the terms of a Business Source License 1.1
2+
3+
package fetcher
4+
5+
import (
6+
"github.com/prometheus/client_golang/prometheus"
7+
8+
"github.com/obolnetwork/charon/app/promauto"
9+
)
10+
11+
var (
12+
proposalBlindedGauge = promauto.NewGauge(prometheus.GaugeOpts{
13+
Namespace: "core",
14+
Subsystem: "fetcher",
15+
Name: "proposal_blinded",
16+
Help: "Whether the fetched proposal was blinded (1) or local (0)",
17+
})
18+
)

docs/metrics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ when storing metrics from multiple nodes or clusters in one Prometheus instance.
5757
| `core_consensus_duration_seconds` | Histogram | Duration of the consensus process by protocol, duty, and timer | `protocol, duty, timer` |
5858
| `core_consensus_error_total` | Counter | Total count of consensus errors by protocol | `protocol` |
5959
| `core_consensus_timeout_total` | Counter | Total count of consensus timeouts by protocol, duty, and timer | `protocol, duty, timer` |
60+
| `core_fetcher_proposal_blinded` | Gauge | Whether the fetched proposal was blinded (1) or local (0) | |
6061
| `core_parsigdb_exit_total` | Counter | Total number of partially signed voluntary exits per public key | `pubkey` |
6162
| `core_scheduler_current_epoch` | Gauge | The current epoch | |
6263
| `core_scheduler_current_slot` | Gauge | The current slot | |

0 commit comments

Comments
 (0)