File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ pub struct TransactionServiceMetrics {
4444 pub blocks_until_inclusion : Histogram ,
4545 /// How long transactions have spent in queue before being sent.
4646 pub time_in_queue : Histogram ,
47+ /// Maximum estimated fee per gas, in wei.
48+ pub max_fee_per_gas : Histogram ,
49+ /// Maximum estimated priority fee per gas, in wei.
50+ pub max_priority_fee_per_gas : Histogram ,
4751}
4852
4953/// Metrics of an individual signer, should be labeled with the signer address and chain ID.
Original file line number Diff line number Diff line change @@ -269,7 +269,10 @@ impl Signer {
269269 /// See also [`FeeConfig::adjusted_eip1559_estimation`]
270270 async fn estimate_eip1559_fees ( & self ) -> TransportResult < Eip1559Estimation > {
271271 let fees = self . provider . estimate_eip1559_fees ( ) . await ?;
272- Ok ( self . fees . adjusted_eip1559_estimation ( fees) )
272+ let adjusted_fees = self . fees . adjusted_eip1559_estimation ( fees) ;
273+ self . metrics . max_fee_per_gas . record ( adjusted_fees. max_fee_per_gas as f64 ) ;
274+ self . metrics . max_priority_fee_per_gas . record ( adjusted_fees. max_priority_fee_per_gas as f64 ) ;
275+ Ok ( adjusted_fees)
273276 }
274277
275278 /// Invoked when a transaction is confirmed.
You can’t perform that action at this time.
0 commit comments