mirror of
https://github.com/ChainSafe/lodestar.git
synced 2026-01-09 07:38:03 -05:00
Adding epoch as a label to the doppelganger metrics
This commit is contained in:
@@ -17,21 +17,23 @@ services:
|
||||
BEACON_URL: localhost:8008
|
||||
VC_URL: localhost:5064
|
||||
restart: always
|
||||
network_mode: host
|
||||
ports:
|
||||
- "9090:9090"
|
||||
volumes:
|
||||
- "prometheus:/prometheus"
|
||||
|
||||
grafana:
|
||||
build: grafana
|
||||
restart: always
|
||||
network_mode: host
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- "grafana:/var/lib/grafana"
|
||||
- "../dashboards:/dashboards"
|
||||
environment:
|
||||
# Linux: http://localhost:9090
|
||||
# MacOSX: http://host.docker.internal:9090
|
||||
PROMETHEUS_URL: http://localhost:9090
|
||||
PROMETHEUS_URL: http://host.docker.internal:9090
|
||||
|
||||
volumes:
|
||||
prometheus:
|
||||
|
||||
@@ -22,6 +22,7 @@ interface Gauge<Labels extends LabelsGeneric = never> {
|
||||
|
||||
interface Histogram<Labels extends LabelsGeneric = never> {
|
||||
startTimer(): () => number;
|
||||
startTimer(labels: Labels): () => number;
|
||||
|
||||
observe(value: number): void;
|
||||
observe(labels: Labels, values: number): void;
|
||||
@@ -321,15 +322,16 @@ export function getMetrics(register: MetricsRegister, gitData: LodestarGitData)
|
||||
// Doppelganger check
|
||||
|
||||
doppelganger: {
|
||||
checkDuration: register.histogram({
|
||||
checkDuration: register.histogram<{epoch: string}>({
|
||||
name: "vc_doppelganger_check_time_seconds",
|
||||
help: "Time to complete a doppelganger check in seconds",
|
||||
buckets: [0.5, 1, 2, 3, 6, 8],
|
||||
labelNames: ["epoch"],
|
||||
}),
|
||||
status: register.gauge<{validatorIndex: string}>({
|
||||
status: register.gauge<{epoch: string; validatorIndex: string}>({
|
||||
name: "vc_doppelganger_validator_status",
|
||||
help: "Statuses of doppelganger check for each validator",
|
||||
labelNames: ["validatorIndex"],
|
||||
labelNames: ["epoch", "validatorIndex"],
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -84,7 +84,7 @@ export class DoppelgangerService {
|
||||
// Run the doppelganger protection check 75% through the last slot of this epoch. This
|
||||
// *should* mean that the BN has seen the blocks and attestations for the epoch
|
||||
await sleep(this.clock.msToSlot(endSlotOfEpoch + 3 / 4));
|
||||
const timer = this.metrics?.doppelganger.checkDuration.startTimer();
|
||||
const timer = this.metrics?.doppelganger.checkDuration.startTimer({epoch: String(currentEpoch)});
|
||||
const indices = await this.getIndicesToCheck(currentEpoch);
|
||||
if (indices.length !== 0) {
|
||||
const previousEpoch = currentEpoch - 1;
|
||||
@@ -142,6 +142,7 @@ export class DoppelgangerService {
|
||||
|
||||
this.metrics?.doppelganger.status.set(
|
||||
{
|
||||
epoch: String(currentEpoch),
|
||||
validatorIndex: String(validatorIndexToBeChecked.index),
|
||||
},
|
||||
doppelgangerStatusMetrics[this.getStatus(validatorIndexToBeChecked.index)]
|
||||
|
||||
Reference in New Issue
Block a user