@aztec/telemetry-client 0.0.1-commit.e6bd8901 → 0.0.1-commit.ec7ac5448
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/dest/attributes.d.ts +11 -1
- package/dest/attributes.d.ts.map +1 -1
- package/dest/attributes.js +5 -0
- package/dest/lmdb_metrics.d.ts +2 -2
- package/dest/lmdb_metrics.d.ts.map +1 -1
- package/dest/metric-utils.d.ts +21 -2
- package/dest/metric-utils.d.ts.map +1 -1
- package/dest/metric-utils.js +52 -0
- package/dest/metrics.d.ts +55 -4
- package/dest/metrics.d.ts.map +1 -1
- package/dest/metrics.js +287 -11
- package/dest/nodejs_metrics_monitor.d.ts +1 -1
- package/dest/nodejs_metrics_monitor.d.ts.map +1 -1
- package/dest/nodejs_metrics_monitor.js +7 -1
- package/dest/otel_resource.d.ts +1 -1
- package/dest/otel_resource.d.ts.map +1 -1
- package/dest/otel_resource.js +14 -2
- package/dest/prom_otel_adapter.d.ts +4 -4
- package/dest/prom_otel_adapter.d.ts.map +1 -1
- package/dest/prom_otel_adapter.js +4 -3
- package/dest/start.d.ts +3 -2
- package/dest/start.d.ts.map +1 -1
- package/dest/start.js +2 -2
- package/dest/telemetry.d.ts +4 -3
- package/dest/telemetry.d.ts.map +1 -1
- package/dest/telemetry.js +1 -1
- package/dest/wrappers/fetch.d.ts +3 -3
- package/dest/wrappers/fetch.d.ts.map +1 -1
- package/dest/wrappers/fetch.js +3 -2
- package/package.json +3 -3
- package/src/attributes.ts +15 -0
- package/src/metric-utils.ts +64 -1
- package/src/metrics.ts +293 -11
- package/src/nodejs_metrics_monitor.ts +4 -1
- package/src/otel_resource.ts +19 -2
- package/src/prom_otel_adapter.ts +4 -5
- package/src/start.ts +6 -3
- package/src/telemetry.ts +4 -2
- package/src/wrappers/fetch.ts +9 -3
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
|
|
348
|
-
name: 'aztec.sequencer.
|
|
349
|
-
description: '
|
|
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
|
|
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
|
|
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,42 @@ 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
|
|
399
|
-
name: 'aztec.sequencer.
|
|
400
|
-
description: 'The number of times
|
|
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',
|
|
479
|
+
valueType: ValueType.INT,
|
|
480
|
+
};
|
|
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_BLOCK_COUNT: MetricDefinition = {
|
|
493
|
+
name: 'aztec.sequencer.checkpoint.block_count',
|
|
494
|
+
description: 'Number of blocks built in a checkpoint',
|
|
495
|
+
valueType: ValueType.INT,
|
|
496
|
+
};
|
|
497
|
+
export const SEQUENCER_CHECKPOINT_TX_COUNT: MetricDefinition = {
|
|
498
|
+
name: 'aztec.sequencer.checkpoint.tx_count',
|
|
499
|
+
description: 'Total number of transactions across all blocks in a checkpoint',
|
|
500
|
+
unit: 'tx',
|
|
401
501
|
valueType: ValueType.INT,
|
|
402
502
|
};
|
|
403
|
-
export const
|
|
404
|
-
name: 'aztec.sequencer.
|
|
405
|
-
description: '
|
|
503
|
+
export const SEQUENCER_CHECKPOINT_TOTAL_MANA: MetricDefinition = {
|
|
504
|
+
name: 'aztec.sequencer.checkpoint.total_mana',
|
|
505
|
+
description: 'Total L2 mana used across all blocks in a checkpoint',
|
|
506
|
+
unit: 'mana',
|
|
406
507
|
valueType: ValueType.INT,
|
|
407
508
|
};
|
|
408
509
|
export const SEQUENCER_SLASHING_ATTEMPTS_COUNT: MetricDefinition = {
|
|
@@ -415,6 +516,16 @@ export const SEQUENCER_CHECKPOINT_SUCCESS_COUNT: MetricDefinition = {
|
|
|
415
516
|
description: 'The number of times checkpoint publishing succeeded',
|
|
416
517
|
valueType: ValueType.INT,
|
|
417
518
|
};
|
|
519
|
+
export const SEQUENCER_PIPELINE_DEPTH: MetricDefinition = {
|
|
520
|
+
name: 'aztec.sequencer.pipeline.depth',
|
|
521
|
+
description: 'Current pipeline depth when builder pipelining is enabled',
|
|
522
|
+
valueType: ValueType.INT,
|
|
523
|
+
};
|
|
524
|
+
export const SEQUENCER_PIPELINE_DISCARDS_COUNT: MetricDefinition = {
|
|
525
|
+
name: 'aztec.sequencer.pipeline.discards_count',
|
|
526
|
+
description: 'The number of times a pipeline was discarded',
|
|
527
|
+
valueType: ValueType.INT,
|
|
528
|
+
};
|
|
418
529
|
|
|
419
530
|
// Fisherman fee analysis metrics
|
|
420
531
|
export const FISHERMAN_FEE_ANALYSIS_WOULD_BE_INCLUDED: MetricDefinition = {
|
|
@@ -474,6 +585,29 @@ export const FISHERMAN_FEE_ANALYSIS_MINED_BLOB_TX_TOTAL_COST: MetricDefinition =
|
|
|
474
585
|
unit: 'eth',
|
|
475
586
|
valueType: ValueType.DOUBLE,
|
|
476
587
|
};
|
|
588
|
+
export const FISHERMAN_FEE_ANALYSIS_PENDING_BLOB_COUNT: MetricDefinition = {
|
|
589
|
+
name: 'aztec.fisherman.fee_analysis.pending_blob_count',
|
|
590
|
+
description: 'Total number of blobs in pending blob transactions',
|
|
591
|
+
unit: 'blobs',
|
|
592
|
+
valueType: ValueType.INT,
|
|
593
|
+
};
|
|
594
|
+
export const FISHERMAN_FEE_ANALYSIS_INCLUDED_BLOB_COUNT: MetricDefinition = {
|
|
595
|
+
name: 'aztec.fisherman.fee_analysis.included_blob_count',
|
|
596
|
+
description: 'Total number of blobs included in the mined block',
|
|
597
|
+
unit: 'blobs',
|
|
598
|
+
valueType: ValueType.INT,
|
|
599
|
+
};
|
|
600
|
+
export const FISHERMAN_FEE_ANALYSIS_BLOCK_BLOBS_FULL: MetricDefinition = {
|
|
601
|
+
name: 'aztec.fisherman.fee_analysis.block_blobs_full',
|
|
602
|
+
description: 'Whether the mined block reached 100% blob capacity',
|
|
603
|
+
valueType: ValueType.INT,
|
|
604
|
+
};
|
|
605
|
+
export const FISHERMAN_FEE_ANALYSIS_MAX_BLOB_CAPACITY: MetricDefinition = {
|
|
606
|
+
name: 'aztec.fisherman.fee_analysis.max_blob_capacity',
|
|
607
|
+
description: 'Maximum blob capacity for the analyzed block based on L1 upgrade schedule',
|
|
608
|
+
unit: 'blobs',
|
|
609
|
+
valueType: ValueType.INT,
|
|
610
|
+
};
|
|
477
611
|
|
|
478
612
|
export const VALIDATOR_INVALID_ATTESTATION_RECEIVED_COUNT: MetricDefinition = {
|
|
479
613
|
name: 'aztec.validator.invalid_attestation_received_count',
|
|
@@ -652,6 +786,12 @@ export const PEER_MANAGER_PEER_COUNT: MetricDefinition = {
|
|
|
652
786
|
unit: 'peers',
|
|
653
787
|
valueType: ValueType.INT,
|
|
654
788
|
};
|
|
789
|
+
export const PEER_MANAGER_HEALTHY_PEER_COUNT: MetricDefinition = {
|
|
790
|
+
name: 'aztec.peer_manager.healthy_peer_count',
|
|
791
|
+
description: 'Number of healthy (non-protected, non-banned) peers',
|
|
792
|
+
unit: 'peers',
|
|
793
|
+
valueType: ValueType.INT,
|
|
794
|
+
};
|
|
655
795
|
export const PEER_MANAGER_LOW_SCORE_DISCONNECTS: MetricDefinition = {
|
|
656
796
|
name: 'aztec.peer_manager.low_score_disconnects',
|
|
657
797
|
description: 'Number of peers disconnected due to low score',
|
|
@@ -936,6 +1076,11 @@ export const PROVING_QUEUE_REJECTED_JOBS: MetricDefinition = {
|
|
|
936
1076
|
description: 'Number of rejected proving jobs',
|
|
937
1077
|
valueType: ValueType.INT,
|
|
938
1078
|
};
|
|
1079
|
+
export const PROVING_QUEUE_ABORTED_JOBS: MetricDefinition = {
|
|
1080
|
+
name: 'aztec.proving_queue.aborted_jobs_count',
|
|
1081
|
+
description: 'Number of aborted proving jobs',
|
|
1082
|
+
valueType: ValueType.INT,
|
|
1083
|
+
};
|
|
939
1084
|
export const PROVING_QUEUE_RETRIED_JOBS: MetricDefinition = {
|
|
940
1085
|
name: 'aztec.proving_queue.retried_jobs_count',
|
|
941
1086
|
description: 'Number of retried proving jobs',
|
|
@@ -1010,6 +1155,36 @@ export const PROVER_NODE_JOB_TRANSACTIONS: MetricDefinition = {
|
|
|
1010
1155
|
description: 'Number of transactions in a proven epoch',
|
|
1011
1156
|
valueType: ValueType.INT,
|
|
1012
1157
|
};
|
|
1158
|
+
export const PROVER_NODE_BLOB_PROCESSING_LAST_DURATION: MetricDefinition = {
|
|
1159
|
+
name: 'aztec.prover_node.blob_processing.last_duration',
|
|
1160
|
+
description: 'Duration of blob processing step in epoch proving job',
|
|
1161
|
+
unit: 'ms',
|
|
1162
|
+
valueType: ValueType.INT,
|
|
1163
|
+
};
|
|
1164
|
+
export const PROVER_NODE_CHONK_VERIFIER_LAST_DURATION: MetricDefinition = {
|
|
1165
|
+
name: 'aztec.prover_node.chonk_verifier.last_duration',
|
|
1166
|
+
description: 'Duration of chonk verifier enqueuing in epoch proving job',
|
|
1167
|
+
unit: 'ms',
|
|
1168
|
+
valueType: ValueType.INT,
|
|
1169
|
+
};
|
|
1170
|
+
export const PROVER_NODE_BLOCK_PROCESSING_DURATION: MetricDefinition = {
|
|
1171
|
+
name: 'aztec.prover_node.block_processing.duration',
|
|
1172
|
+
description: 'Duration of processing a single block in epoch proving job',
|
|
1173
|
+
unit: 'ms',
|
|
1174
|
+
valueType: ValueType.INT,
|
|
1175
|
+
};
|
|
1176
|
+
export const PROVER_NODE_CHECKPOINT_PROCESSING_DURATION: MetricDefinition = {
|
|
1177
|
+
name: 'aztec.prover_node.checkpoint_processing.duration',
|
|
1178
|
+
description: 'Duration of processing a single checkpoint in epoch proving job',
|
|
1179
|
+
unit: 'ms',
|
|
1180
|
+
valueType: ValueType.INT,
|
|
1181
|
+
};
|
|
1182
|
+
export const PROVER_NODE_ALL_CHECKPOINTS_PROCESSING_LAST_DURATION: MetricDefinition = {
|
|
1183
|
+
name: 'aztec.prover_node.all_checkpoints_processing.last_duration',
|
|
1184
|
+
description: 'Duration of processing all checkpoints in epoch proving job',
|
|
1185
|
+
unit: 'ms',
|
|
1186
|
+
valueType: ValueType.INT,
|
|
1187
|
+
};
|
|
1013
1188
|
export const PROVER_NODE_REWARDS_TOTAL: MetricDefinition = {
|
|
1014
1189
|
name: 'aztec.prover_node.rewards_total',
|
|
1015
1190
|
description: 'The rewards earned (total)',
|
|
@@ -1144,6 +1319,16 @@ export const VALIDATOR_ATTESTATION_FAILED_NODE_ISSUE_COUNT: MetricDefinition = {
|
|
|
1144
1319
|
description: 'The number of failed attestations due to node issues (timeout, missing data, etc.)',
|
|
1145
1320
|
valueType: ValueType.INT,
|
|
1146
1321
|
};
|
|
1322
|
+
export const VALIDATOR_CURRENT_EPOCH: MetricDefinition = {
|
|
1323
|
+
name: 'aztec.validator.current_epoch',
|
|
1324
|
+
description: 'The current epoch number, reflecting total epochs elapsed since genesis',
|
|
1325
|
+
valueType: ValueType.INT,
|
|
1326
|
+
};
|
|
1327
|
+
export const VALIDATOR_ATTESTED_EPOCH_COUNT: MetricDefinition = {
|
|
1328
|
+
name: 'aztec.validator.attested_epoch_count',
|
|
1329
|
+
description: 'The number of epochs in which this node successfully submitted at least one attestation',
|
|
1330
|
+
valueType: ValueType.INT,
|
|
1331
|
+
};
|
|
1147
1332
|
|
|
1148
1333
|
export const NODEJS_EVENT_LOOP_DELAY_MIN: MetricDefinition = {
|
|
1149
1334
|
name: 'nodejs.eventloop.delay.min',
|
|
@@ -1271,6 +1456,55 @@ export const TX_COLLECTOR_DURATION_PER_TX: MetricDefinition = {
|
|
|
1271
1456
|
valueType: ValueType.INT,
|
|
1272
1457
|
};
|
|
1273
1458
|
|
|
1459
|
+
export const TX_FILE_STORE_UPLOADS_SUCCESS: MetricDefinition = {
|
|
1460
|
+
name: 'aztec.p2p.tx_file_store.uploads_success',
|
|
1461
|
+
description: 'Number of successful tx uploads to file storage',
|
|
1462
|
+
valueType: ValueType.INT,
|
|
1463
|
+
};
|
|
1464
|
+
export const TX_FILE_STORE_UPLOADS_FAILED: MetricDefinition = {
|
|
1465
|
+
name: 'aztec.p2p.tx_file_store.uploads_failed',
|
|
1466
|
+
description: 'Number of failed tx uploads to file storage',
|
|
1467
|
+
valueType: ValueType.INT,
|
|
1468
|
+
};
|
|
1469
|
+
export const TX_FILE_STORE_UPLOADS_SKIPPED: MetricDefinition = {
|
|
1470
|
+
name: 'aztec.p2p.tx_file_store.uploads_skipped',
|
|
1471
|
+
description: 'Number of tx uploads skipped (duplicates)',
|
|
1472
|
+
valueType: ValueType.INT,
|
|
1473
|
+
};
|
|
1474
|
+
export const TX_FILE_STORE_UPLOAD_DURATION: MetricDefinition = {
|
|
1475
|
+
name: 'aztec.p2p.tx_file_store.upload_duration',
|
|
1476
|
+
description: 'Duration to upload a tx to file storage',
|
|
1477
|
+
unit: 'ms',
|
|
1478
|
+
valueType: ValueType.INT,
|
|
1479
|
+
};
|
|
1480
|
+
export const TX_FILE_STORE_QUEUE_SIZE: MetricDefinition = {
|
|
1481
|
+
name: 'aztec.p2p.tx_file_store.queue_size',
|
|
1482
|
+
description: 'Number of txs pending upload',
|
|
1483
|
+
valueType: ValueType.INT,
|
|
1484
|
+
};
|
|
1485
|
+
export const TX_FILE_STORE_DOWNLOADS_SUCCESS: MetricDefinition = {
|
|
1486
|
+
name: 'aztec.p2p.tx_file_store.downloads_success',
|
|
1487
|
+
description: 'Number of successful tx downloads from file storage',
|
|
1488
|
+
valueType: ValueType.INT,
|
|
1489
|
+
};
|
|
1490
|
+
export const TX_FILE_STORE_DOWNLOADS_FAILED: MetricDefinition = {
|
|
1491
|
+
name: 'aztec.p2p.tx_file_store.downloads_failed',
|
|
1492
|
+
description: 'Number of failed tx downloads from file storage',
|
|
1493
|
+
valueType: ValueType.INT,
|
|
1494
|
+
};
|
|
1495
|
+
export const TX_FILE_STORE_DOWNLOAD_DURATION: MetricDefinition = {
|
|
1496
|
+
name: 'aztec.p2p.tx_file_store.download_duration',
|
|
1497
|
+
description: 'Duration to download a tx from file storage',
|
|
1498
|
+
unit: 'ms',
|
|
1499
|
+
valueType: ValueType.INT,
|
|
1500
|
+
};
|
|
1501
|
+
export const TX_FILE_STORE_DOWNLOAD_SIZE: MetricDefinition = {
|
|
1502
|
+
name: 'aztec.p2p.tx_file_store.download_size',
|
|
1503
|
+
description: 'Size of a downloaded tx from file storage',
|
|
1504
|
+
unit: 'By',
|
|
1505
|
+
valueType: ValueType.INT,
|
|
1506
|
+
};
|
|
1507
|
+
|
|
1274
1508
|
export const IVC_VERIFIER_TIME: MetricDefinition = {
|
|
1275
1509
|
name: 'aztec.ivc_verifier.time',
|
|
1276
1510
|
description: 'Duration to verify chonk proofs',
|
|
@@ -1319,3 +1553,51 @@ export const IVC_VERIFIER_AGG_DURATION_AVG: MetricDefinition = {
|
|
|
1319
1553
|
unit: 'ms',
|
|
1320
1554
|
valueType: ValueType.DOUBLE,
|
|
1321
1555
|
};
|
|
1556
|
+
|
|
1557
|
+
// HA Signer metrics
|
|
1558
|
+
export const HA_SIGNER_SIGNING_DURATION: MetricDefinition = {
|
|
1559
|
+
name: 'aztec.ha_signer.signing_duration',
|
|
1560
|
+
description: 'End-to-end duration for signing with HA protection (lock + sign + record)',
|
|
1561
|
+
unit: 'ms',
|
|
1562
|
+
valueType: ValueType.INT,
|
|
1563
|
+
};
|
|
1564
|
+
export const HA_SIGNER_SIGNING_SUCCESS_COUNT: MetricDefinition = {
|
|
1565
|
+
name: 'aztec.ha_signer.signing_success_count',
|
|
1566
|
+
description: 'Count of successful signing operations',
|
|
1567
|
+
valueType: ValueType.INT,
|
|
1568
|
+
};
|
|
1569
|
+
export const HA_SIGNER_DUTY_ALREADY_SIGNED_COUNT: MetricDefinition = {
|
|
1570
|
+
name: 'aztec.ha_signer.duty_already_signed_count',
|
|
1571
|
+
description: 'Count of DutyAlreadySignedError (expected in HA; another node signed first)',
|
|
1572
|
+
valueType: ValueType.INT,
|
|
1573
|
+
};
|
|
1574
|
+
export const HA_SIGNER_SLASHING_PROTECTION_COUNT: MetricDefinition = {
|
|
1575
|
+
name: 'aztec.ha_signer.slashing_protection_count',
|
|
1576
|
+
description: 'Count of SlashingProtectionError (attempted to sign different data)',
|
|
1577
|
+
valueType: ValueType.INT,
|
|
1578
|
+
};
|
|
1579
|
+
export const HA_SIGNER_SIGNING_ERROR_COUNT: MetricDefinition = {
|
|
1580
|
+
name: 'aztec.ha_signer.signing_error_count',
|
|
1581
|
+
description: 'Count of signing function failures (lock deleted for retry)',
|
|
1582
|
+
valueType: ValueType.INT,
|
|
1583
|
+
};
|
|
1584
|
+
export const HA_SIGNER_LOCK_ACQUIRED_COUNT: MetricDefinition = {
|
|
1585
|
+
name: 'aztec.ha_signer.lock_acquired_count',
|
|
1586
|
+
description: 'Count of lock acquisitions (new lock acquired vs existing record found)',
|
|
1587
|
+
valueType: ValueType.INT,
|
|
1588
|
+
};
|
|
1589
|
+
export const HA_SIGNER_CLEANUP_STUCK_DUTIES_COUNT: MetricDefinition = {
|
|
1590
|
+
name: 'aztec.ha_signer.cleanup_stuck_duties_count',
|
|
1591
|
+
description: 'Number of stuck duties cleaned up per cleanup run',
|
|
1592
|
+
valueType: ValueType.INT,
|
|
1593
|
+
};
|
|
1594
|
+
export const HA_SIGNER_CLEANUP_OLD_DUTIES_COUNT: MetricDefinition = {
|
|
1595
|
+
name: 'aztec.ha_signer.cleanup_old_duties_count',
|
|
1596
|
+
description: 'Number of old duties cleaned up',
|
|
1597
|
+
valueType: ValueType.INT,
|
|
1598
|
+
};
|
|
1599
|
+
export const HA_SIGNER_CLEANUP_OUTDATED_ROLLUP_DUTIES_COUNT: MetricDefinition = {
|
|
1600
|
+
name: 'aztec.ha_signer.cleanup_outdated_rollup_duties_count',
|
|
1601
|
+
description: 'Number of duties cleaned due to rollup upgrade',
|
|
1602
|
+
valueType: ValueType.INT,
|
|
1603
|
+
};
|
|
@@ -2,6 +2,7 @@ import type { Observable } from '@opentelemetry/api';
|
|
|
2
2
|
import { type EventLoopUtilization, type IntervalHistogram, monitorEventLoopDelay, performance } from 'node:perf_hooks';
|
|
3
3
|
|
|
4
4
|
import * as Attributes from './attributes.js';
|
|
5
|
+
import { createUpDownCounterWithDefault } from './metric-utils.js';
|
|
5
6
|
import * as Metrics from './metrics.js';
|
|
6
7
|
import type { BatchObservableResult, Meter, ObservableGauge, UpDownCounter } from './telemetry.js';
|
|
7
8
|
|
|
@@ -41,7 +42,9 @@ export class NodejsMetricsMonitor {
|
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
this.eventLoopUilization = meter.createObservableGauge(Metrics.NODEJS_EVENT_LOOP_UTILIZATION);
|
|
44
|
-
this.eventLoopTime = meter
|
|
45
|
+
this.eventLoopTime = createUpDownCounterWithDefault(meter, Metrics.NODEJS_EVENT_LOOP_TIME, {
|
|
46
|
+
[Attributes.NODEJS_EVENT_LOOP_STATE]: ['idle', 'active'],
|
|
47
|
+
});
|
|
45
48
|
this.eventLoopDelay = monitorEventLoopDelay();
|
|
46
49
|
|
|
47
50
|
this.memoryGauges = {
|
package/src/otel_resource.ts
CHANGED
|
@@ -7,10 +7,26 @@ import {
|
|
|
7
7
|
osDetectorSync,
|
|
8
8
|
serviceInstanceIdDetectorSync,
|
|
9
9
|
} from '@opentelemetry/resources';
|
|
10
|
-
import {
|
|
10
|
+
import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from '@opentelemetry/semantic-conventions';
|
|
11
|
+
import { readFileSync } from 'fs';
|
|
12
|
+
import { dirname, resolve } from 'path';
|
|
13
|
+
import { fileURLToPath } from 'url';
|
|
11
14
|
|
|
12
15
|
import { AZTEC_NODE_ROLE, AZTEC_REGISTRY_ADDRESS, AZTEC_ROLLUP_ADDRESS, AZTEC_ROLLUP_VERSION } from './attributes.js';
|
|
13
16
|
|
|
17
|
+
/** Reads the Aztec client version from the release manifest. */
|
|
18
|
+
function getAztecVersion(): string | undefined {
|
|
19
|
+
try {
|
|
20
|
+
const releasePleasePath = resolve(
|
|
21
|
+
dirname(fileURLToPath(import.meta.url)),
|
|
22
|
+
'../../../.release-please-manifest.json',
|
|
23
|
+
);
|
|
24
|
+
return JSON.parse(readFileSync(releasePleasePath, 'utf-8'))['.'];
|
|
25
|
+
} catch {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
14
30
|
export function getOtelResource(): IResource {
|
|
15
31
|
const resource = detectResourcesSync({
|
|
16
32
|
detectors: [
|
|
@@ -42,7 +58,8 @@ const aztecNetworkDetectorSync: DetectorSync = {
|
|
|
42
58
|
}
|
|
43
59
|
const aztecAttributes = {
|
|
44
60
|
// this gets overwritten by OTEL_RESOURCE_ATTRIBUTES (if set)
|
|
45
|
-
[
|
|
61
|
+
[ATTR_SERVICE_NAME]: role ? `aztec-${role}` : undefined,
|
|
62
|
+
[ATTR_SERVICE_VERSION]: getAztecVersion(),
|
|
46
63
|
[AZTEC_NODE_ROLE]: role,
|
|
47
64
|
[AZTEC_ROLLUP_VERSION]: process.env.ROLLUP_VERSION ?? 'canonical',
|
|
48
65
|
[AZTEC_ROLLUP_ADDRESS]: process.env.ROLLUP_CONTRACT_ADDRESS,
|
package/src/prom_otel_adapter.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
1
|
+
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import { Timer } from '@aztec/foundation/timer';
|
|
3
3
|
|
|
4
4
|
import { Registry } from 'prom-client';
|
|
@@ -410,12 +410,11 @@ function parseLabelsSafely<Labels extends LabelsGeneric>(labelStr: string, logge
|
|
|
410
410
|
*/
|
|
411
411
|
export class OtelMetricsAdapter extends Registry implements MetricsRegister {
|
|
412
412
|
private readonly meter: Meter;
|
|
413
|
+
private logger: Logger;
|
|
413
414
|
|
|
414
|
-
constructor(
|
|
415
|
-
telemetryClient: TelemetryClient,
|
|
416
|
-
private logger: Logger = createLogger('telemetry:otel-metrics-adapter'),
|
|
417
|
-
) {
|
|
415
|
+
constructor(telemetryClient: TelemetryClient, bindings?: LoggerBindings) {
|
|
418
416
|
super();
|
|
417
|
+
this.logger = createLogger('telemetry:otel-metrics-adapter', bindings);
|
|
419
418
|
this.meter = telemetryClient.getMeter('metrics-adapter');
|
|
420
419
|
}
|
|
421
420
|
|
package/src/start.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
1
|
+
import { type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
2
2
|
|
|
3
3
|
import type { TelemetryClientConfig } from './config.js';
|
|
4
4
|
import { NoopTelemetryClient } from './noop.js';
|
|
@@ -9,8 +9,11 @@ export * from './config.js';
|
|
|
9
9
|
let initialized = false;
|
|
10
10
|
let telemetry: TelemetryClient = new NoopTelemetryClient();
|
|
11
11
|
|
|
12
|
-
export async function initTelemetryClient(
|
|
13
|
-
|
|
12
|
+
export async function initTelemetryClient(
|
|
13
|
+
config: TelemetryClientConfig,
|
|
14
|
+
bindings?: LoggerBindings,
|
|
15
|
+
): Promise<TelemetryClient> {
|
|
16
|
+
const log = createLogger('telemetry:client', bindings);
|
|
14
17
|
if (initialized) {
|
|
15
18
|
log.warn('Telemetry client has already been initialized once');
|
|
16
19
|
return telemetry;
|
package/src/telemetry.ts
CHANGED
|
@@ -20,7 +20,7 @@ import type * as Attributes from './attributes.js';
|
|
|
20
20
|
import type { MetricDefinition } from './metrics.js';
|
|
21
21
|
import { getTelemetryClient } from './start.js';
|
|
22
22
|
|
|
23
|
-
export { toMetricOptions } from './metric-utils.js';
|
|
23
|
+
export { toMetricOptions, createUpDownCounterWithDefault } from './metric-utils.js';
|
|
24
24
|
|
|
25
25
|
export { type Span, SpanStatusCode, ValueType, type Context } from '@opentelemetry/api';
|
|
26
26
|
|
|
@@ -56,8 +56,10 @@ type BannedMetricAttributeNames = (typeof Attributes)[
|
|
|
56
56
|
/** Global registry of attributes */
|
|
57
57
|
export type AttributesType = Partial<Record<AttributeNames, AttributeValue>>;
|
|
58
58
|
|
|
59
|
+
export type AllowedAttributeNames = Exclude<AttributeNames, BannedMetricAttributeNames>;
|
|
60
|
+
|
|
59
61
|
/** Subset of attributes allowed to be added to metrics */
|
|
60
|
-
export type MetricAttributesType = Partial<Record<
|
|
62
|
+
export type MetricAttributesType = Partial<Record<AllowedAttributeNames, AttributeValue>>;
|
|
61
63
|
|
|
62
64
|
/** Re-export MetricDefinition for convenience */
|
|
63
65
|
export type { MetricDefinition } from './metrics.js';
|
package/src/wrappers/fetch.ts
CHANGED
|
@@ -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(
|
|
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
|
-
|
|
39
|
+
backoff,
|
|
34
40
|
log,
|
|
35
41
|
false,
|
|
36
42
|
);
|