@@ -10,6 +10,7 @@ import {
1010 type TelemetryClient ,
1111 type Tracer ,
1212 type UpDownCounter ,
13+ createUpDownCounterWithDefault ,
1314} from '@aztec/telemetry-client' ;
1415
1516export class ArchiverInstrumentation {
@@ -48,29 +49,37 @@ export class ArchiverInstrumentation {
4849
4950 this . l1BlockHeight = meter . createGauge ( Metrics . ARCHIVER_L1_BLOCK_HEIGHT ) ;
5051
51- this . txCount = meter . createUpDownCounter ( Metrics . ARCHIVER_TOTAL_TXS ) ;
52+ this . txCount = createUpDownCounterWithDefault ( meter , Metrics . ARCHIVER_TOTAL_TXS ) ;
5253
53- this . proofsSubmittedCount = meter . createUpDownCounter ( Metrics . ARCHIVER_ROLLUP_PROOF_COUNT ) ;
54+ this . proofsSubmittedCount = createUpDownCounterWithDefault ( meter , Metrics . ARCHIVER_ROLLUP_PROOF_COUNT , {
55+ [ Attributes . PROOF_TIMED_OUT ] : [ true , false ] ,
56+ } ) ;
5457
5558 this . proofsSubmittedDelay = meter . createHistogram ( Metrics . ARCHIVER_ROLLUP_PROOF_DELAY ) ;
5659
5760 this . syncDurationPerBlock = meter . createHistogram ( Metrics . ARCHIVER_SYNC_PER_BLOCK ) ;
5861
59- this . syncBlockCount = meter . createUpDownCounter ( Metrics . ARCHIVER_SYNC_BLOCK_COUNT ) ;
62+ this . syncBlockCount = createUpDownCounterWithDefault ( meter , Metrics . ARCHIVER_SYNC_BLOCK_COUNT ) ;
6063
6164 this . manaPerBlock = meter . createHistogram ( Metrics . ARCHIVER_MANA_PER_BLOCK ) ;
6265
6366 this . txsPerBlock = meter . createHistogram ( Metrics . ARCHIVER_TXS_PER_BLOCK ) ;
6467
6568 this . syncDurationPerMessage = meter . createHistogram ( Metrics . ARCHIVER_SYNC_PER_MESSAGE ) ;
6669
67- this . syncMessageCount = meter . createUpDownCounter ( Metrics . ARCHIVER_SYNC_MESSAGE_COUNT ) ;
70+ this . syncMessageCount = createUpDownCounterWithDefault ( meter , Metrics . ARCHIVER_SYNC_MESSAGE_COUNT ) ;
6871
6972 this . pruneDuration = meter . createHistogram ( Metrics . ARCHIVER_PRUNE_DURATION ) ;
7073
71- this . pruneCount = meter . createUpDownCounter ( Metrics . ARCHIVER_PRUNE_COUNT ) ;
74+ this . pruneCount = createUpDownCounterWithDefault ( meter , Metrics . ARCHIVER_PRUNE_COUNT ) ;
7275
73- this . blockProposalTxTargetCount = meter . createUpDownCounter ( Metrics . ARCHIVER_BLOCK_PROPOSAL_TX_TARGET_COUNT ) ;
76+ this . blockProposalTxTargetCount = createUpDownCounterWithDefault (
77+ meter ,
78+ Metrics . ARCHIVER_BLOCK_PROPOSAL_TX_TARGET_COUNT ,
79+ {
80+ [ Attributes . L1_BLOCK_PROPOSAL_USED_TRACE ] : [ true , false ] ,
81+ } ,
82+ ) ;
7483
7584 this . dbMetrics = new LmdbMetrics (
7685 meter ,
@@ -84,10 +93,6 @@ export class ArchiverInstrumentation {
8493 public static async new ( telemetry : TelemetryClient , lmdbStats ?: LmdbStatsCallback ) {
8594 const instance = new ArchiverInstrumentation ( telemetry , lmdbStats ) ;
8695
87- instance . syncBlockCount . add ( 0 ) ;
88- instance . syncMessageCount . add ( 0 ) ;
89- instance . pruneCount . add ( 0 ) ;
90-
9196 await instance . telemetry . flush ( ) ;
9297
9398 return instance ;
0 commit comments