@aztec/telemetry-client 0.0.1-commit.ee80a48 → 0.0.1-commit.f103f88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/metrics.ts CHANGED
@@ -167,6 +167,55 @@ export const MEMPOOL_TX_MINED_DELAY: MetricDefinition = {
167
167
  valueType: ValueType.INT,
168
168
  };
169
169
 
170
+ export const MEMPOOL_TX_POOL_V2_EVICTED_COUNT: MetricDefinition = {
171
+ name: 'aztec.mempool.tx_pool_v2.evicted_count',
172
+ description: 'The number of transactions evicted from the tx pool',
173
+ valueType: ValueType.INT,
174
+ };
175
+ export const MEMPOOL_TX_POOL_V2_IGNORED_COUNT: MetricDefinition = {
176
+ name: 'aztec.mempool.tx_pool_v2.ignored_count',
177
+ description: 'The number of transactions ignored in addPendingTxs',
178
+ valueType: ValueType.INT,
179
+ };
180
+ export const MEMPOOL_TX_POOL_V2_REJECTED_COUNT: MetricDefinition = {
181
+ name: 'aztec.mempool.tx_pool_v2.rejected_count',
182
+ description: 'The number of transactions rejected in addPendingTxs',
183
+ valueType: ValueType.INT,
184
+ };
185
+ export const MEMPOOL_TX_POOL_V2_SOFT_DELETED_HITS: MetricDefinition = {
186
+ name: 'aztec.mempool.tx_pool_v2.soft_deleted_hits',
187
+ description: 'The number of transactions found in the soft-deleted pool',
188
+ valueType: ValueType.INT,
189
+ };
190
+ export const MEMPOOL_TX_POOL_V2_MISSING_ON_PROTECT: MetricDefinition = {
191
+ name: 'aztec.mempool.tx_pool_v2.missing_on_protect',
192
+ description: 'The number of truly missing transactions in protectTxs',
193
+ valueType: ValueType.INT,
194
+ };
195
+ export const MEMPOOL_TX_POOL_V2_MISSING_PREVIOUSLY_EVICTED: MetricDefinition = {
196
+ name: 'aztec.mempool.tx_pool_v2.missing_previously_evicted',
197
+ description: 'The number of truly missing transactions in protectTxs that were previously evicted',
198
+ valueType: ValueType.INT,
199
+ };
200
+ export const MEMPOOL_TX_POOL_V2_METADATA_MEMORY: MetricDefinition = {
201
+ name: 'aztec.mempool.tx_pool_v2.metadata_memory',
202
+ description: 'Estimated total memory consumed by in-memory transaction metadata',
203
+ unit: 'By',
204
+ valueType: ValueType.INT,
205
+ };
206
+
207
+ export const MEMPOOL_TX_POOL_V2_DUPLICATE_ADD: MetricDefinition = {
208
+ name: 'aztec.mempool.tx_pool_v2.duplicate_add',
209
+ description: 'Transactions received via addPendingTxs that were already in the pool',
210
+ valueType: ValueType.INT,
211
+ };
212
+
213
+ export const MEMPOOL_TX_POOL_V2_ALREADY_PROTECTED_ADD: MetricDefinition = {
214
+ name: 'aztec.mempool.tx_pool_v2.already_protected_add',
215
+ description: 'Transactions received via addPendingTxs that were already pre-protected',
216
+ valueType: ValueType.INT,
217
+ };
218
+
170
219
  export const DB_NUM_ITEMS: MetricDefinition = {
171
220
  name: 'aztec.db.num_items',
172
221
  description: 'LMDB Num Items',
@@ -224,6 +273,11 @@ export const ARCHIVER_BLOCK_HEIGHT: MetricDefinition = {
224
273
  description: 'The height of the latest block processed by the archiver',
225
274
  valueType: ValueType.INT,
226
275
  };
276
+ export const ARCHIVER_CHECKPOINT_HEIGHT: MetricDefinition = {
277
+ name: 'aztec.archiver.checkpoint_height',
278
+ description: 'The height of the latest checkpoint processed by the archiver',
279
+ valueType: ValueType.INT,
280
+ };
227
281
  export const ARCHIVER_ROLLUP_PROOF_DELAY: MetricDefinition = {
228
282
  name: 'aztec.archiver.rollup_proof_delay',
229
283
  description: 'Time after a block is submitted until its proof is published',
@@ -254,6 +308,12 @@ export const ARCHIVER_SYNC_PER_BLOCK: MetricDefinition = {
254
308
  unit: 'ms',
255
309
  valueType: ValueType.INT,
256
310
  };
311
+ export const ARCHIVER_SYNC_PER_CHECKPOINT: MetricDefinition = {
312
+ name: 'aztec.archiver.checkpoint.sync_per_item_duration',
313
+ description: 'Duration to sync a checkpoint',
314
+ unit: 'ms',
315
+ valueType: ValueType.INT,
316
+ };
257
317
  export const ARCHIVER_SYNC_BLOCK_COUNT: MetricDefinition = {
258
318
  name: 'aztec.archiver.block.sync_count',
259
319
  description: 'Number of blocks synced from L1',
@@ -296,6 +356,13 @@ export const ARCHIVER_BLOCK_PROPOSAL_TX_TARGET_COUNT: MetricDefinition = {
296
356
  valueType: ValueType.INT,
297
357
  };
298
358
 
359
+ export const ARCHIVER_CHECKPOINT_L1_INCLUSION_DELAY: MetricDefinition = {
360
+ name: 'aztec.archiver.checkpoint_l1_inclusion_delay',
361
+ description: 'Seconds into the L2 slot when the checkpoint L1 tx was included',
362
+ unit: 's',
363
+ valueType: ValueType.INT,
364
+ };
365
+
299
366
  export const NODE_RECEIVE_TX_DURATION: MetricDefinition = {
300
367
  name: 'aztec.node.receive_tx.duration',
301
368
  description: 'The duration of the receiveTx method',
@@ -344,9 +411,15 @@ export const SEQUENCER_BLOCK_COUNT: MetricDefinition = {
344
411
  description: 'Number of blocks built by this sequencer',
345
412
  valueType: ValueType.INT,
346
413
  };
347
- export const SEQUENCER_CURRENT_BLOCK_REWARDS: MetricDefinition = {
348
- name: 'aztec.sequencer.current_block_rewards',
349
- description: 'The rewards earned',
414
+ export const SEQUENCER_BLOCK_INTER_BLOCK_TIME: MetricDefinition = {
415
+ name: 'aztec.sequencer.block.inter_block_time',
416
+ description: 'Wall-clock time elapsed between consecutive blocks being built by this sequencer',
417
+ unit: 'ms',
418
+ valueType: ValueType.INT,
419
+ };
420
+ export const SEQUENCER_CURRENT_SLOT_REWARDS: MetricDefinition = {
421
+ name: 'aztec.sequencer.current_slot_rewards',
422
+ description: 'The rewards earned per filled slot',
350
423
  valueType: ValueType.DOUBLE,
351
424
  };
352
425
  export const SEQUENCER_SLOT_COUNT: MetricDefinition = {
@@ -369,12 +442,12 @@ export const SEQUENCER_CHECKPOINT_ATTESTATION_DELAY: MetricDefinition = {
369
442
 
370
443
  export const SEQUENCER_COLLECTED_ATTESTATIONS_COUNT: MetricDefinition = {
371
444
  name: 'aztec.sequencer.attestations.collected_count',
372
- description: 'The number of attestations collected for a block proposal',
445
+ description: 'The number of attestations collected for a checkpoint proposal',
373
446
  valueType: ValueType.INT,
374
447
  };
375
448
  export const SEQUENCER_REQUIRED_ATTESTATIONS_COUNT: MetricDefinition = {
376
449
  name: 'aztec.sequencer.attestations.required_count',
377
- description: 'The minimum number of attestations required to publish a block',
450
+ description: 'The minimum number of attestations required to publish a checkpoint',
378
451
  valueType: ValueType.INT,
379
452
  };
380
453
  export const SEQUENCER_COLLECT_ATTESTATIONS_DURATION: MetricDefinition = {
@@ -395,14 +468,61 @@ export const SEQUENCER_BLOCK_PROPOSAL_FAILED_COUNT: MetricDefinition = {
395
468
  description: 'The number of times block proposal failed (including validation builds)',
396
469
  valueType: ValueType.INT,
397
470
  };
398
- export const SEQUENCER_BLOCK_PROPOSAL_SUCCESS_COUNT: MetricDefinition = {
399
- name: 'aztec.sequencer.block.proposal_success_count',
400
- description: 'The number of times block proposal succeeded (including validation builds)',
471
+ export const SEQUENCER_CHECKPOINT_PROPOSAL_SUCCESS_COUNT: MetricDefinition = {
472
+ name: 'aztec.sequencer.checkpoint.proposal_success_count',
473
+ description: 'The number of times checkpoint proposal succeeded',
474
+ valueType: ValueType.INT,
475
+ };
476
+ export const SEQUENCER_CHECKPOINT_PRECHECK_FAILED_COUNT: MetricDefinition = {
477
+ name: 'aztec.sequencer.checkpoint.precheck_failed_count',
478
+ description: 'The number of times checkpoint pre-build checks failed',
401
479
  valueType: ValueType.INT,
402
480
  };
403
- export const SEQUENCER_BLOCK_PROPOSAL_PRECHECK_FAILED_COUNT: MetricDefinition = {
404
- name: 'aztec.sequencer.block.proposal_precheck_failed_count',
405
- description: 'The number of times block proposal pre-build checks failed',
481
+ export const SEQUENCER_CHECKPOINT_PROPOSAL_FAILED_COUNT: MetricDefinition = {
482
+ name: 'aztec.sequencer.checkpoint.proposal_failed_count',
483
+ description: 'The number of times checkpoint proposal failed',
484
+ valueType: ValueType.INT,
485
+ };
486
+ export const SEQUENCER_CHECKPOINT_BUILD_DURATION: MetricDefinition = {
487
+ name: 'aztec.sequencer.checkpoint.build_duration',
488
+ description: 'Total duration to build all blocks in a checkpoint',
489
+ unit: 'ms',
490
+ valueType: ValueType.INT,
491
+ };
492
+ export const SEQUENCER_CHECKPOINT_START_TO_FIRST_BLOCK_DURATION: MetricDefinition = {
493
+ name: 'aztec.sequencer.checkpoint.start_to_first_block_duration',
494
+ description: 'Time from starting checkpoint work to the first block finishing build',
495
+ unit: 'ms',
496
+ valueType: ValueType.INT,
497
+ };
498
+ export const SEQUENCER_CHECKPOINT_LAST_BLOCK_TO_BROADCAST_DURATION: MetricDefinition = {
499
+ name: 'aztec.sequencer.checkpoint.last_block_to_broadcast_duration',
500
+ description: 'Time from the final block finishing build to the checkpoint proposal being broadcast',
501
+ unit: 'ms',
502
+ valueType: ValueType.INT,
503
+ };
504
+ export const SEQUENCER_PIPELINED_CHECKPOINT_BUILD_START_OFFSET_FROM_SLOT_BOUNDARY: MetricDefinition = {
505
+ name: 'aztec.sequencer.pipelined_checkpoint.build_start_offset_from_slot_boundary',
506
+ description:
507
+ 'Absolute offset from the wall-clock slot boundary when a pipelined checkpoint build starts. Use aztec.slot_boundary_side to distinguish before vs after the boundary.',
508
+ unit: 'ms',
509
+ valueType: ValueType.INT,
510
+ };
511
+ export const SEQUENCER_CHECKPOINT_BLOCK_COUNT: MetricDefinition = {
512
+ name: 'aztec.sequencer.checkpoint.block_count',
513
+ description: 'Number of blocks built in a checkpoint',
514
+ valueType: ValueType.INT,
515
+ };
516
+ export const SEQUENCER_CHECKPOINT_TX_COUNT: MetricDefinition = {
517
+ name: 'aztec.sequencer.checkpoint.tx_count',
518
+ description: 'Total number of transactions across all blocks in a checkpoint',
519
+ unit: 'tx',
520
+ valueType: ValueType.INT,
521
+ };
522
+ export const SEQUENCER_CHECKPOINT_TOTAL_MANA: MetricDefinition = {
523
+ name: 'aztec.sequencer.checkpoint.total_mana',
524
+ description: 'Total L2 mana used across all blocks in a checkpoint',
525
+ unit: 'mana',
406
526
  valueType: ValueType.INT,
407
527
  };
408
528
  export const SEQUENCER_SLASHING_ATTEMPTS_COUNT: MetricDefinition = {
@@ -415,6 +535,16 @@ export const SEQUENCER_CHECKPOINT_SUCCESS_COUNT: MetricDefinition = {
415
535
  description: 'The number of times checkpoint publishing succeeded',
416
536
  valueType: ValueType.INT,
417
537
  };
538
+ export const SEQUENCER_PIPELINE_DEPTH: MetricDefinition = {
539
+ name: 'aztec.sequencer.pipeline.depth',
540
+ description: 'Current pipeline depth when builder pipelining is enabled',
541
+ valueType: ValueType.INT,
542
+ };
543
+ export const SEQUENCER_PIPELINE_DISCARDS_COUNT: MetricDefinition = {
544
+ name: 'aztec.sequencer.pipeline.discards_count',
545
+ description: 'The number of times a pipeline was discarded',
546
+ valueType: ValueType.INT,
547
+ };
418
548
 
419
549
  // Fisherman fee analysis metrics
420
550
  export const FISHERMAN_FEE_ANALYSIS_WOULD_BE_INCLUDED: MetricDefinition = {
@@ -474,6 +604,29 @@ export const FISHERMAN_FEE_ANALYSIS_MINED_BLOB_TX_TOTAL_COST: MetricDefinition =
474
604
  unit: 'eth',
475
605
  valueType: ValueType.DOUBLE,
476
606
  };
607
+ export const FISHERMAN_FEE_ANALYSIS_PENDING_BLOB_COUNT: MetricDefinition = {
608
+ name: 'aztec.fisherman.fee_analysis.pending_blob_count',
609
+ description: 'Total number of blobs in pending blob transactions',
610
+ unit: 'blobs',
611
+ valueType: ValueType.INT,
612
+ };
613
+ export const FISHERMAN_FEE_ANALYSIS_INCLUDED_BLOB_COUNT: MetricDefinition = {
614
+ name: 'aztec.fisherman.fee_analysis.included_blob_count',
615
+ description: 'Total number of blobs included in the mined block',
616
+ unit: 'blobs',
617
+ valueType: ValueType.INT,
618
+ };
619
+ export const FISHERMAN_FEE_ANALYSIS_BLOCK_BLOBS_FULL: MetricDefinition = {
620
+ name: 'aztec.fisherman.fee_analysis.block_blobs_full',
621
+ description: 'Whether the mined block reached 100% blob capacity',
622
+ valueType: ValueType.INT,
623
+ };
624
+ export const FISHERMAN_FEE_ANALYSIS_MAX_BLOB_CAPACITY: MetricDefinition = {
625
+ name: 'aztec.fisherman.fee_analysis.max_blob_capacity',
626
+ description: 'Maximum blob capacity for the analyzed block based on L1 upgrade schedule',
627
+ unit: 'blobs',
628
+ valueType: ValueType.INT,
629
+ };
477
630
 
478
631
  export const VALIDATOR_INVALID_ATTESTATION_RECEIVED_COUNT: MetricDefinition = {
479
632
  name: 'aztec.validator.invalid_attestation_received_count',
@@ -652,6 +805,12 @@ export const PEER_MANAGER_PEER_COUNT: MetricDefinition = {
652
805
  unit: 'peers',
653
806
  valueType: ValueType.INT,
654
807
  };
808
+ export const PEER_MANAGER_HEALTHY_PEER_COUNT: MetricDefinition = {
809
+ name: 'aztec.peer_manager.healthy_peer_count',
810
+ description: 'Number of healthy (non-protected, non-banned) peers',
811
+ unit: 'peers',
812
+ valueType: ValueType.INT,
813
+ };
655
814
  export const PEER_MANAGER_LOW_SCORE_DISCONNECTS: MetricDefinition = {
656
815
  name: 'aztec.peer_manager.low_score_disconnects',
657
816
  description: 'Number of peers disconnected due to low score',
@@ -936,6 +1095,11 @@ export const PROVING_QUEUE_REJECTED_JOBS: MetricDefinition = {
936
1095
  description: 'Number of rejected proving jobs',
937
1096
  valueType: ValueType.INT,
938
1097
  };
1098
+ export const PROVING_QUEUE_ABORTED_JOBS: MetricDefinition = {
1099
+ name: 'aztec.proving_queue.aborted_jobs_count',
1100
+ description: 'Number of aborted proving jobs',
1101
+ valueType: ValueType.INT,
1102
+ };
939
1103
  export const PROVING_QUEUE_RETRIED_JOBS: MetricDefinition = {
940
1104
  name: 'aztec.proving_queue.retried_jobs_count',
941
1105
  description: 'Number of retried proving jobs',
@@ -1010,6 +1174,36 @@ export const PROVER_NODE_JOB_TRANSACTIONS: MetricDefinition = {
1010
1174
  description: 'Number of transactions in a proven epoch',
1011
1175
  valueType: ValueType.INT,
1012
1176
  };
1177
+ export const PROVER_NODE_BLOB_PROCESSING_LAST_DURATION: MetricDefinition = {
1178
+ name: 'aztec.prover_node.blob_processing.last_duration',
1179
+ description: 'Duration of blob processing step in epoch proving job',
1180
+ unit: 'ms',
1181
+ valueType: ValueType.INT,
1182
+ };
1183
+ export const PROVER_NODE_CHONK_VERIFIER_LAST_DURATION: MetricDefinition = {
1184
+ name: 'aztec.prover_node.chonk_verifier.last_duration',
1185
+ description: 'Duration of chonk verifier enqueuing in epoch proving job',
1186
+ unit: 'ms',
1187
+ valueType: ValueType.INT,
1188
+ };
1189
+ export const PROVER_NODE_BLOCK_PROCESSING_DURATION: MetricDefinition = {
1190
+ name: 'aztec.prover_node.block_processing.duration',
1191
+ description: 'Duration of processing a single block in epoch proving job',
1192
+ unit: 'ms',
1193
+ valueType: ValueType.INT,
1194
+ };
1195
+ export const PROVER_NODE_CHECKPOINT_PROCESSING_DURATION: MetricDefinition = {
1196
+ name: 'aztec.prover_node.checkpoint_processing.duration',
1197
+ description: 'Duration of processing a single checkpoint in epoch proving job',
1198
+ unit: 'ms',
1199
+ valueType: ValueType.INT,
1200
+ };
1201
+ export const PROVER_NODE_ALL_CHECKPOINTS_PROCESSING_LAST_DURATION: MetricDefinition = {
1202
+ name: 'aztec.prover_node.all_checkpoints_processing.last_duration',
1203
+ description: 'Duration of processing all checkpoints in epoch proving job',
1204
+ unit: 'ms',
1205
+ valueType: ValueType.INT,
1206
+ };
1013
1207
  export const PROVER_NODE_REWARDS_TOTAL: MetricDefinition = {
1014
1208
  name: 'aztec.prover_node.rewards_total',
1015
1209
  description: 'The rewards earned (total)',
@@ -1123,6 +1317,19 @@ export const VALIDATOR_RE_EXECUTION_TX_COUNT: MetricDefinition = {
1123
1317
  unit: 'tx',
1124
1318
  valueType: ValueType.INT,
1125
1319
  };
1320
+ export const VALIDATOR_CHECKPOINT_PROPOSAL_TO_PIPELINED_STATE_DURATION: MetricDefinition = {
1321
+ name: 'aztec.validator.checkpoint_proposal_to_pipelined_state_duration',
1322
+ description: 'Time from receiving a checkpoint proposal to setting proposed checkpoint state for pipelining',
1323
+ unit: 'ms',
1324
+ valueType: ValueType.INT,
1325
+ };
1326
+ export const VALIDATOR_CHECKPOINT_PROPOSAL_RECEIVE_OFFSET_FROM_NEXT_SLOT_BOUNDARY: MetricDefinition = {
1327
+ name: 'aztec.validator.checkpoint.proposal_receive_offset_from_next_slot_boundary',
1328
+ description:
1329
+ 'Absolute offset from the next slot boundary when a foreign checkpoint proposal is received. Use aztec.slot_boundary_side to distinguish before vs after the boundary.',
1330
+ unit: 'ms',
1331
+ valueType: ValueType.INT,
1332
+ };
1126
1333
 
1127
1334
  export const VALIDATOR_FAILED_REEXECUTION_COUNT: MetricDefinition = {
1128
1335
  name: 'aztec.validator.failed_reexecution_count',
@@ -1144,6 +1351,16 @@ export const VALIDATOR_ATTESTATION_FAILED_NODE_ISSUE_COUNT: MetricDefinition = {
1144
1351
  description: 'The number of failed attestations due to node issues (timeout, missing data, etc.)',
1145
1352
  valueType: ValueType.INT,
1146
1353
  };
1354
+ export const VALIDATOR_CURRENT_EPOCH: MetricDefinition = {
1355
+ name: 'aztec.validator.current_epoch',
1356
+ description: 'The current epoch number, reflecting total epochs elapsed since genesis',
1357
+ valueType: ValueType.INT,
1358
+ };
1359
+ export const VALIDATOR_ATTESTED_EPOCH_COUNT: MetricDefinition = {
1360
+ name: 'aztec.validator.attested_epoch_count',
1361
+ description: 'The number of epochs in which this node successfully submitted at least one attestation',
1362
+ valueType: ValueType.INT,
1363
+ };
1147
1364
 
1148
1365
  export const NODEJS_EVENT_LOOP_DELAY_MIN: MetricDefinition = {
1149
1366
  name: 'nodejs.eventloop.delay.min',
@@ -1271,6 +1488,55 @@ export const TX_COLLECTOR_DURATION_PER_TX: MetricDefinition = {
1271
1488
  valueType: ValueType.INT,
1272
1489
  };
1273
1490
 
1491
+ export const TX_FILE_STORE_UPLOADS_SUCCESS: MetricDefinition = {
1492
+ name: 'aztec.p2p.tx_file_store.uploads_success',
1493
+ description: 'Number of successful tx uploads to file storage',
1494
+ valueType: ValueType.INT,
1495
+ };
1496
+ export const TX_FILE_STORE_UPLOADS_FAILED: MetricDefinition = {
1497
+ name: 'aztec.p2p.tx_file_store.uploads_failed',
1498
+ description: 'Number of failed tx uploads to file storage',
1499
+ valueType: ValueType.INT,
1500
+ };
1501
+ export const TX_FILE_STORE_UPLOADS_SKIPPED: MetricDefinition = {
1502
+ name: 'aztec.p2p.tx_file_store.uploads_skipped',
1503
+ description: 'Number of tx uploads skipped (duplicates)',
1504
+ valueType: ValueType.INT,
1505
+ };
1506
+ export const TX_FILE_STORE_UPLOAD_DURATION: MetricDefinition = {
1507
+ name: 'aztec.p2p.tx_file_store.upload_duration',
1508
+ description: 'Duration to upload a tx to file storage',
1509
+ unit: 'ms',
1510
+ valueType: ValueType.INT,
1511
+ };
1512
+ export const TX_FILE_STORE_QUEUE_SIZE: MetricDefinition = {
1513
+ name: 'aztec.p2p.tx_file_store.queue_size',
1514
+ description: 'Number of txs pending upload',
1515
+ valueType: ValueType.INT,
1516
+ };
1517
+ export const TX_FILE_STORE_DOWNLOADS_SUCCESS: MetricDefinition = {
1518
+ name: 'aztec.p2p.tx_file_store.downloads_success',
1519
+ description: 'Number of successful tx downloads from file storage',
1520
+ valueType: ValueType.INT,
1521
+ };
1522
+ export const TX_FILE_STORE_DOWNLOADS_FAILED: MetricDefinition = {
1523
+ name: 'aztec.p2p.tx_file_store.downloads_failed',
1524
+ description: 'Number of failed tx downloads from file storage',
1525
+ valueType: ValueType.INT,
1526
+ };
1527
+ export const TX_FILE_STORE_DOWNLOAD_DURATION: MetricDefinition = {
1528
+ name: 'aztec.p2p.tx_file_store.download_duration',
1529
+ description: 'Duration to download a tx from file storage',
1530
+ unit: 'ms',
1531
+ valueType: ValueType.INT,
1532
+ };
1533
+ export const TX_FILE_STORE_DOWNLOAD_SIZE: MetricDefinition = {
1534
+ name: 'aztec.p2p.tx_file_store.download_size',
1535
+ description: 'Size of a downloaded tx from file storage',
1536
+ unit: 'By',
1537
+ valueType: ValueType.INT,
1538
+ };
1539
+
1274
1540
  export const IVC_VERIFIER_TIME: MetricDefinition = {
1275
1541
  name: 'aztec.ivc_verifier.time',
1276
1542
  description: 'Duration to verify chonk proofs',
@@ -1319,3 +1585,51 @@ export const IVC_VERIFIER_AGG_DURATION_AVG: MetricDefinition = {
1319
1585
  unit: 'ms',
1320
1586
  valueType: ValueType.DOUBLE,
1321
1587
  };
1588
+
1589
+ // HA Signer metrics
1590
+ export const HA_SIGNER_SIGNING_DURATION: MetricDefinition = {
1591
+ name: 'aztec.ha_signer.signing_duration',
1592
+ description: 'End-to-end duration for signing with HA protection (lock + sign + record)',
1593
+ unit: 'ms',
1594
+ valueType: ValueType.INT,
1595
+ };
1596
+ export const HA_SIGNER_SIGNING_SUCCESS_COUNT: MetricDefinition = {
1597
+ name: 'aztec.ha_signer.signing_success_count',
1598
+ description: 'Count of successful signing operations',
1599
+ valueType: ValueType.INT,
1600
+ };
1601
+ export const HA_SIGNER_DUTY_ALREADY_SIGNED_COUNT: MetricDefinition = {
1602
+ name: 'aztec.ha_signer.duty_already_signed_count',
1603
+ description: 'Count of DutyAlreadySignedError (expected in HA; another node signed first)',
1604
+ valueType: ValueType.INT,
1605
+ };
1606
+ export const HA_SIGNER_SLASHING_PROTECTION_COUNT: MetricDefinition = {
1607
+ name: 'aztec.ha_signer.slashing_protection_count',
1608
+ description: 'Count of SlashingProtectionError (attempted to sign different data)',
1609
+ valueType: ValueType.INT,
1610
+ };
1611
+ export const HA_SIGNER_SIGNING_ERROR_COUNT: MetricDefinition = {
1612
+ name: 'aztec.ha_signer.signing_error_count',
1613
+ description: 'Count of signing function failures (lock deleted for retry)',
1614
+ valueType: ValueType.INT,
1615
+ };
1616
+ export const HA_SIGNER_LOCK_ACQUIRED_COUNT: MetricDefinition = {
1617
+ name: 'aztec.ha_signer.lock_acquired_count',
1618
+ description: 'Count of lock acquisitions (new lock acquired vs existing record found)',
1619
+ valueType: ValueType.INT,
1620
+ };
1621
+ export const HA_SIGNER_CLEANUP_STUCK_DUTIES_COUNT: MetricDefinition = {
1622
+ name: 'aztec.ha_signer.cleanup_stuck_duties_count',
1623
+ description: 'Number of stuck duties cleaned up per cleanup run',
1624
+ valueType: ValueType.INT,
1625
+ };
1626
+ export const HA_SIGNER_CLEANUP_OLD_DUTIES_COUNT: MetricDefinition = {
1627
+ name: 'aztec.ha_signer.cleanup_old_duties_count',
1628
+ description: 'Number of old duties cleaned up',
1629
+ valueType: ValueType.INT,
1630
+ };
1631
+ export const HA_SIGNER_CLEANUP_OUTDATED_ROLLUP_DUTIES_COUNT: MetricDefinition = {
1632
+ name: 'aztec.ha_signer.cleanup_outdated_rollup_duties_count',
1633
+ description: 'Number of duties cleaned due to rollup upgrade',
1634
+ valueType: ValueType.INT,
1635
+ };
@@ -9,12 +9,17 @@ import { ATTR_JSONRPC_METHOD, ATTR_JSONRPC_REQUEST_ID } from '../vendor/attribut
9
9
 
10
10
  /**
11
11
  * Makes a fetch function that retries based on the given attempts and propagates trace information.
12
- * @param retries - Sequence of intervals (in seconds) to retry.
12
+ * @param retries - Sequence of intervals (in seconds) to retry, or a factory function returning an iterator for custom/indefinite backoff.
13
13
  * @param noRetry - Whether to stop retries on server errors.
14
14
  * @param log - Optional logger for logging attempts.
15
15
  * @returns A fetch function.
16
16
  */
17
- export function makeTracedFetch(retries: number[], defaultNoRetry: boolean, fetch = defaultFetch, log?: Logger) {
17
+ export function makeTracedFetch(
18
+ retries: number[] | (() => Generator<number>),
19
+ defaultNoRetry: boolean,
20
+ fetch = defaultFetch,
21
+ log?: Logger,
22
+ ) {
18
23
  return (host: string, body: unknown, extraHeaders: Record<string, string> = {}, noRetry?: boolean) => {
19
24
  const telemetry = getTelemetryClient();
20
25
  return telemetry.getTracer('fetch').startActiveSpan(`JsonRpcClient`, { kind: SpanKind.CLIENT }, async span => {
@@ -27,10 +32,11 @@ export function makeTracedFetch(retries: number[], defaultNoRetry: boolean, fetc
27
32
  }
28
33
  const headers = { ...extraHeaders };
29
34
  propagation.inject(context.active(), headers);
35
+ const backoff = typeof retries === 'function' ? retries() : makeBackoff(retries);
30
36
  return await retry(
31
37
  () => fetch(host, body, headers, noRetry ?? defaultNoRetry),
32
38
  `JsonRpcClient request to ${host}`,
33
- makeBackoff(retries),
39
+ backoff,
34
40
  log,
35
41
  false,
36
42
  );