diff --git a/bin/rundler/src/cli/tracing.rs b/bin/rundler/src/cli/tracing.rs index 7b54d274f..3e245aa85 100644 --- a/bin/rundler/src/cli/tracing.rs +++ b/bin/rundler/src/cli/tracing.rs @@ -35,14 +35,14 @@ pub fn configure_logging(config: &LogsArgs) -> anyhow::Result { let metadata = MetadataMap::new(); - // let exporter = opentelemetry_otlp::SpanExporter::builder() - // .with_http() - // .with_endpoint("http://127.0.0.1:4318") - // .with_protocol(opentelemetry_otlp::Protocol::HttpBinary) - // .with_timeout(Duration::from_secs(3)) - // // .with_metadata(metadata) - // .build()?; - let exporter = opentelemetry_stdout::SpanExporter::default(); + let exporter = opentelemetry_otlp::SpanExporter::builder() + .with_tonic() + .with_endpoint("http://127.0.0.1:4317") + .with_protocol(opentelemetry_otlp::Protocol::HttpBinary) + .with_timeout(Duration::from_secs(3)) + .with_metadata(metadata) + .build()?; + // let exporter = opentelemetry_stdout::SpanExporter::default(); let tracer_provider = opentelemetry_sdk::trace::SdkTracerProvider::builder() .with_batch_exporter(exporter) .with_resource(Resource::builder().with_service_name("rundler").build()) diff --git a/crates/rpc/src/eth/router.rs b/crates/rpc/src/eth/router.rs index 0c6bfb2e0..7a56e59a5 100644 --- a/crates/rpc/src/eth/router.rs +++ b/crates/rpc/src/eth/router.rs @@ -11,7 +11,11 @@ // You should have received a copy of the GNU General Public License along with Rundler. // If not, see https://www.gnu.org/licenses/. -use std::{fmt::Debug, marker::PhantomData, sync::Arc}; +use std::{ + fmt::{self, Debug}, + marker::PhantomData, + sync::Arc, +}; use alloy_primitives::{Address, B256}; use rundler_provider::{EntryPoint, SimulationProvider, StateOverride}; @@ -85,6 +89,14 @@ pub(crate) struct EntryPointRouter { v0_7: Option<(Address, Arc)>, } +impl fmt::Debug for EntryPointRouter { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("EntryPointRouter") + .field("entry_points", &self.entry_points) + .finish() + } +} + impl EntryPointRouter { pub(crate) fn entry_points(&self) -> impl Iterator { self.entry_points.iter() diff --git a/crates/rpc/src/rundler.rs b/crates/rpc/src/rundler.rs index 57c4993ee..f995780df 100644 --- a/crates/rpc/src/rundler.rs +++ b/crates/rpc/src/rundler.rs @@ -17,7 +17,7 @@ use async_trait::async_trait; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; use rundler_sim::{gas, FeeEstimator}; use rundler_types::{chain::ChainSpec, pool::Pool, UserOperation, UserOperationVariant}; -use tracing::{info, info_span}; +use tracing::instrument; use crate::{ eth::{EntryPointRouter, EthResult, EthRpcError}, @@ -70,12 +70,15 @@ where P: Pool + 'static, F: FeeEstimator + 'static, { + #[instrument( + name = "RundlerApiServer::max_priority_fee_per_gas", + skip(self), + fields(force_trace_sample = true) + )] async fn max_priority_fee_per_gas(&self) -> RpcResult { - let span = info_span!("max_priority_fee_per_gas api"); - let x = span.in_scope(|| self); utils::safe_call_rpc_handler( "rundler_maxPriorityFeePerGas", - RundlerApi::max_priority_fee_per_gas(x), + RundlerApi::max_priority_fee_per_gas(self), ) .await } @@ -112,13 +115,11 @@ where } } - async fn max_priority_fee_per_gas(&self) -> EthResult { - let span = info_span!("max_priority_fee_per_gas impl"); - let x = span.in_scope(|| None); - info!("here is a log"); + #[instrument(skip(self))] + async fn simple_wrapper(&self) -> EthResult { let (bundle_fees, _) = self .fee_estimator - .required_bundle_fees(x) + .required_bundle_fees(None) .await .context("should get required fees")?; Ok(U128::from( @@ -128,6 +129,11 @@ where )) } + #[instrument(name = "RundlerApi::max_priority_fee_per_gas", skip(self))] + async fn max_priority_fee_per_gas(&self) -> EthResult { + self.simple_wrapper().await + } + async fn drop_local_user_operation( &self, user_op: RpcUserOperation, diff --git a/crates/sim/src/gas/gas.rs b/crates/sim/src/gas/gas.rs index 133ff1c2f..df31a1922 100644 --- a/crates/sim/src/gas/gas.rs +++ b/crates/sim/src/gas/gas.rs @@ -20,7 +20,6 @@ use rundler_provider::{BlockHashOrNumber, DAGasProvider, EvmProvider}; use rundler_types::{chain::ChainSpec, da::DAGasUOData, GasFees, UserOperation}; use rundler_utils::math; use tokio::try_join; -use tracing::info_span; use super::oracle::FeeOracle; @@ -219,8 +218,6 @@ impl FeeEstimator for FeeEstimatorImpl { &self, min_fees: Option, ) -> anyhow::Result<(GasFees, u128)> { - let span = info_span!("max_priority_fee_per_gas innner "); - let (base_fee, priority_fee) = try_join!(self.get_pending_base_fee(), self.get_priority_fee())?;