Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions yarn-project/prover-node/src/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class ProverNodeMetrics {
txCalldataGas: Histogram;
txBlobDataGasUsed: Histogram;
txBlobDataGasCost: Histogram;
txTotalFee: Histogram;

private senderBalance: Gauge;

Expand Down Expand Up @@ -100,6 +101,17 @@ export class ProverNodeMetrics {
valueType: ValueType.INT,
});

this.txTotalFee = meter.createHistogram(Metrics.L1_PUBLISHER_TX_TOTAL_FEE, {
description: 'How much L1 tx costs',
unit: 'gwei',
valueType: ValueType.DOUBLE,
advice: {
explicitBucketBoundaries: [
0.001, 0.002, 0.004, 0.008, 0.01, 0.02, 0.04, 0.08, 0.1, 0.2, 0.4, 0.8, 1, 1.2, 1.4, 1.8, 2,
],
},
});

this.senderBalance = meter.createGauge(Metrics.L1_PUBLISHER_BALANCE, {
unit: 'eth',
description: 'The balance of the sender address',
Expand Down Expand Up @@ -160,5 +172,15 @@ export class ProverNodeMetrics {
} catch (e) {
// ignore
}

const executionFee = stats.gasUsed * stats.gasPrice;
const blobFee = stats.blobGasUsed * stats.blobDataGas;
const totalFee = executionFee + blobFee;

try {
this.txTotalFee.record(parseFloat(formatEther(totalFee)));
} catch (e) {
// ignore
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class SequencerPublisherMetrics {
private txCalldataGas: Histogram;
private txBlobDataGasUsed: Histogram;
private txBlobDataGasCost: Histogram;
private txTotalFee: Histogram;

private readonly blobCountHistogram: Histogram;
private readonly blobInclusionBlocksHistogram: Histogram;
Expand Down Expand Up @@ -105,6 +106,17 @@ export class SequencerPublisherMetrics {
description: 'Number of failed L1 transactions with blobs',
});

this.txTotalFee = meter.createHistogram(Metrics.L1_PUBLISHER_TX_TOTAL_FEE, {
description: 'How much L1 tx costs',
unit: 'eth',
valueType: ValueType.DOUBLE,
advice: {
explicitBucketBoundaries: [
0.001, 0.002, 0.004, 0.008, 0.01, 0.02, 0.04, 0.08, 0.1, 0.2, 0.4, 0.8, 1, 1.2, 1.4, 1.8, 2,
],
},
});

this.senderBalance = meter.createGauge(Metrics.L1_PUBLISHER_BALANCE, {
unit: 'eth',
description: 'The balance of the sender address',
Expand Down Expand Up @@ -172,5 +184,15 @@ export class SequencerPublisherMetrics {
} catch (e) {
// ignore
}

const executionFee = stats.gasUsed * stats.gasPrice;
const blobFee = stats.blobGasUsed * stats.blobDataGas;
const totalFee = executionFee + blobFee;

try {
this.txTotalFee.record(parseFloat(formatEther(totalFee)));
} catch (e) {
// ignore
}
}
}
1 change: 1 addition & 0 deletions yarn-project/telemetry-client/src/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const L1_PUBLISHER_BLOB_INCLUSION_BLOCKS = 'aztec.l1_publisher.blob_inclu
export const L1_PUBLISHER_BLOB_TX_SUCCESS = 'aztec.l1_publisher.blob_tx_success';
export const L1_PUBLISHER_BLOB_TX_FAILURE = 'aztec.l1_publisher.blob_tx_failure';
export const L1_PUBLISHER_BALANCE = 'aztec.l1_publisher.balance';
export const L1_PUBLISHER_TX_TOTAL_FEE = 'aztec.l1_publisher.tx_total_fee';

export const L1_BLOCK_HEIGHT = 'aztec.l1.block_height';
export const L1_BALANCE_ETH = 'aztec.l1.balance';
Expand Down