From e6da94c4ae5a92442dee65cb93bb055da7ae544d Mon Sep 17 00:00:00 2001 From: Mitch Date: Fri, 6 Dec 2024 16:51:13 -0500 Subject: [PATCH] add counter for l1 blocks synced --- yarn-project/archiver/src/archiver/instrumentation.ts | 7 +++++++ yarn-project/telemetry-client/src/metrics.ts | 1 + 2 files changed, 8 insertions(+) diff --git a/yarn-project/archiver/src/archiver/instrumentation.ts b/yarn-project/archiver/src/archiver/instrumentation.ts index 7c44a9a46186..37194e735286 100644 --- a/yarn-project/archiver/src/archiver/instrumentation.ts +++ b/yarn-project/archiver/src/archiver/instrumentation.ts @@ -18,6 +18,7 @@ export class ArchiverInstrumentation { private blockHeight: Gauge; private blockSize: Gauge; private syncDuration: Histogram; + private l1BlocksSynced: UpDownCounter; private proofsSubmittedDelay: Histogram; private proofsSubmittedCount: UpDownCounter; private dbMetrics: LmdbMetrics; @@ -59,6 +60,11 @@ export class ArchiverInstrumentation { }, }); + this.l1BlocksSynced = meter.createUpDownCounter(Metrics.ARCHIVER_L1_BLOCKS_SYNCED, { + description: 'Number of blocks synced from L1', + valueType: ValueType.INT, + }); + this.dbMetrics = new LmdbMetrics( meter, { @@ -84,6 +90,7 @@ export class ArchiverInstrumentation { public processNewBlocks(syncTimePerBlock: number, blocks: L2Block[]) { this.syncDuration.record(Math.ceil(syncTimePerBlock)); this.blockHeight.record(Math.max(...blocks.map(b => b.number))); + this.l1BlocksSynced.add(blocks.length); for (const block of blocks) { this.blockSize.record(block.body.txEffects.length); } diff --git a/yarn-project/telemetry-client/src/metrics.ts b/yarn-project/telemetry-client/src/metrics.ts index d737e6dd8634..e894f2e3d0bd 100644 --- a/yarn-project/telemetry-client/src/metrics.ts +++ b/yarn-project/telemetry-client/src/metrics.ts @@ -36,6 +36,7 @@ export const MEMPOOL_PROVER_QUOTE_COUNT = 'aztec.mempool.prover_quote_count'; export const MEMPOOL_PROVER_QUOTE_SIZE = 'aztec.mempool.prover_quote_size'; export const ARCHIVER_SYNC_DURATION = 'aztec.archiver.sync_duration'; +export const ARCHIVER_L1_BLOCKS_SYNCED = 'aztec.archiver.l1_blocks_synced'; export const ARCHIVER_BLOCK_HEIGHT = 'aztec.archiver.block_height'; export const ARCHIVER_BLOCK_SIZE = 'aztec.archiver.block_size'; export const ARCHIVER_ROLLUP_PROOF_DELAY = 'aztec.archiver.rollup_proof_delay';