Skip to content

Commit

Permalink
chore: despam mm proxy logs
Browse files Browse the repository at this point in the history
The MM proxy logs are completely blotted at the info level by
instrumentation calls, rendering them effectively useless at the info
level.

This moves instrumentation down to DEBUG and TRACE levels, so they're
still available, without spamming hundreds of MB in user-facing logs.
  • Loading branch information
CjS77 committed Nov 29, 2023
1 parent c54478f commit e34f098
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions applications/minotari_merge_mining_proxy/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ struct InnerService {
}

impl InnerService {
#[instrument]
#[instrument(level = "trace")]
#[allow(clippy::cast_possible_wrap)]
async fn handle_get_height(&self, monerod_resp: Response<json::Value>) -> Result<Response<Body>, MmProxyError> {
let (parts, mut json) = monerod_resp.into_parts();
Expand All @@ -177,7 +177,7 @@ impl InnerService {
}

let mut base_node_client = self.base_node_client.clone();
trace!(target: LOG_TARGET, "Successful connection to base node GRPC");
info!(target: LOG_TARGET, "Successful connection to base node GRPC");

let result =
base_node_client
Expand All @@ -203,7 +203,7 @@ impl InnerService {
);
}

debug!(
info!(
target: LOG_TARGET,
"Monero height = #{}, Minotari base node height = #{}", json["height"], height
);
Expand Down
8 changes: 4 additions & 4 deletions base_layer/core/src/base_node/sync/rpc/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ impl<B: BlockchainBackend + 'static> BaseNodeSyncService for BaseNodeSyncRpcServ
Ok(Streaming::new(rx))
}

#[instrument(skip(self), err)]
#[instrument(level = "trace", skip(self), err)]
async fn get_header_by_height(
&self,
request: Request<u64>,
Expand Down Expand Up @@ -450,7 +450,7 @@ impl<B: BlockchainBackend + 'static> BaseNodeSyncService for BaseNodeSyncRpcServ
}
}

#[instrument(skip(self), err)]
#[instrument(level = "trace", skip(self), err)]
async fn get_chain_metadata(&self, _: Request<()>) -> Result<Response<proto::base_node::ChainMetadata>, RpcStatus> {
let chain_metadata = self
.db()
Expand All @@ -460,7 +460,7 @@ impl<B: BlockchainBackend + 'static> BaseNodeSyncService for BaseNodeSyncRpcServ
Ok(Response::new(chain_metadata.into()))
}

#[instrument(skip(self), err)]
#[instrument(level = "trace", skip(self), err)]
async fn sync_kernels(
&self,
request: Request<SyncKernelsRequest>,
Expand Down Expand Up @@ -586,7 +586,7 @@ impl<B: BlockchainBackend + 'static> BaseNodeSyncService for BaseNodeSyncRpcServ
Ok(Streaming::new(rx))
}

#[instrument(skip(self), err)]
#[instrument(level = "trace", skip(self), err)]
async fn sync_utxos(&self, request: Request<SyncUtxosRequest>) -> Result<Streaming<SyncUtxosResponse>, RpcStatus> {
let req = request.message();
let peer_node_id = request.context().peer_node_id();
Expand Down
2 changes: 1 addition & 1 deletion comms/core/src/protocol/rpc/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ where
Ok(())
}

#[instrument(name = "rpc::server::handle_req", skip(self, request), err, fields(request_size = request.len()))]
#[instrument(name = "rpc::server::handle_req", level="trace", skip(self, request), err, fields(request_size = request.len ()))]
async fn handle_request(&mut self, mut request: Bytes) -> Result<(), RpcServerError> {
let decoded_msg = proto::rpc::RpcRequest::decode(&mut request)?;

Expand Down

0 comments on commit e34f098

Please sign in to comment.