Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jul 31, 2024. It is now read-only.
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
7 changes: 6 additions & 1 deletion 7 dappnode_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@
"EXECUTION_CLIENT_GNOSIS",
"CONSENSUS_CLIENT_GNOSIS",
"EXECUTION_CLIENT_LUKSO",
"CONSENSUS_CLIENT_LUKSO"
"CONSENSUS_CLIENT_LUKSO",
"MEVBOOST_MAINNET",
"MEVBOOST_GNOSIS",
"MEVBOOST_PRATER",
"MEVBOOST_LUKSO"
],

"services": ["stakers-metrics"]
}
],
Expand Down
41 changes: 0 additions & 41 deletions 41 releases.json

This file was deleted.

25 changes: 25 additions & 0 deletions 25 stakers-metrics/src/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ const executionPeerCountMetric = new promClient.Gauge({
},
});

const mevBoostMetric = new promClient.Gauge({
name: "mev_boost_enabled",
help: "MEV Boost status for each network (1 if enabled, 0 if disabled)",
labelNames: ["network"],
async collect() {
await Promise.all(networks.map((network) => collectMevBoostMetric(network)));
},
});


async function collectPeerCount(network: typeof networks[number], type: "execution" | "consensus") {
const clientUrl = getClientUrl(network, type);
if (!clientUrl) {
Expand Down Expand Up @@ -96,10 +106,25 @@ async function collectSyncingMetric(network: typeof networks[number], type: "exe
metric.set({ network: network }, isSyncing);
}

async function collectMevBoostMetric(network: typeof networks[number]) {

const mevBoostStatus = getMevBoostStatus(network);
mevBoostMetric.set({ network }, mevBoostStatus);
}

function getMevBoostStatus(network: typeof networks[number]): number {
const envKey = `_DAPPNODE_GLOBAL_MEVBOOST_${network.toUpperCase()}`;

const mevBoostValue = process.env[envKey];


return mevBoostValue === "true" ? 1 : 0;
}

register.registerMetric(consensusPeerCountMetric);
register.registerMetric(executionPeerCountMetric);
register.registerMetric(executionSyncingMetric);
register.registerMetric(consensusSyncingMetric);
register.registerMetric(mevBoostMetric);

export { register };
Morty Proxy This is a proxified and sanitized view of the page, visit original site.