Commit ffb1fc41 authored by patrick's avatar patrick
Browse files

Revert "add id to tracing span"

This reverts commit 5e01e6be.
parent 5e01e6be
......@@ -189,7 +189,7 @@ impl ClientT for HttpClient {
let guard = self.id_manager.next_request_id()?;
let id = guard.inner();
let request = RequestSer::new(&id, method, params);
let trace = RpcTracing::method_call(method, &id);
let trace = RpcTracing::method_call(method);
let _enter = trace.span().enter();
let raw = serde_json::to_string(&request).map_err(Error::ParseError)?;
......
......@@ -269,7 +269,7 @@ impl ClientT for Client {
let (send_back_tx, send_back_rx) = oneshot::channel();
let guard = self.id_manager.next_request_id()?;
let id = guard.inner();
let trace = RpcTracing::method_call(method, &id);
let trace = RpcTracing::method_call(method);
let _enter = trace.span().enter();
let raw = serde_json::to_string(&RequestSer::new(&id, method, params)).map_err(Error::ParseError)?;
......@@ -363,11 +363,10 @@ impl SubscriptionClientT for Client {
let guard = self.id_manager.next_request_ids(2)?;
let mut ids: Vec<Id> = guard.inner();
let id = ids[0].clone();
let trace = RpcTracing::method_call(subscribe_method, &id);
let trace = RpcTracing::method_call(subscribe_method);
let _enter = trace.span().enter();
let id = ids[0].clone();
let raw = serde_json::to_string(&RequestSer::new(&id, subscribe_method, params)).map_err(Error::ParseError)?;
......
use serde::Serialize;
use tracing::Level;
use jsonrpsee_types::Id;
#[derive(Debug)]
/// Wrapper over [`tracing::Span`] to trace individual method calls, notifications and similar.
......@@ -10,8 +9,8 @@ impl RpcTracing {
/// Create a `method_call` tracing target.
///
/// To enable this you need to call `RpcTracing::method_call("some_method").span().enable()`.
pub fn method_call(method: &str, id:&Id) -> Self {
Self(tracing::span!(tracing::Level::DEBUG, "method_call", %method, id =? id))
pub fn method_call(method: &str) -> Self {
Self(tracing::span!(tracing::Level::DEBUG, "method_call", %method))
}
/// Create a `notification` tracing target.
......
......@@ -685,8 +685,7 @@ async fn process_health_request<M: Middleware>(
request_start: M::Instant,
max_log_length: u32,
) -> Result<hyper::Response<hyper::Body>, HyperError> {
let id = Id::Number(100);
let trace = RpcTracing::method_call(&health_api.method, &id);
let trace = RpcTracing::method_call(&health_api.method);
let _enter = trace.span().enter();
tx_log_from_str("HTTP health API", max_log_length);
......@@ -806,7 +805,7 @@ where
async fn process_single_request<M: Middleware>(data: Vec<u8>, call: CallData<'_, M>) -> MethodResponse {
if let Ok(req) = serde_json::from_slice::<Request>(&data) {
let trace = RpcTracing::method_call(&req.method, &req.id);
let trace = RpcTracing::method_call(&req.method);
let _enter = trace.span().enter();
rx_log_from_json(&req, call.max_log_length);
......
......@@ -893,7 +893,7 @@ where
async fn process_single_request<M: Middleware>(data: Vec<u8>, call: CallData<'_, M>) -> MethodResult {
if let Ok(req) = serde_json::from_slice::<Request>(&data) {
let trace = RpcTracing::method_call(&req.method, &req.id);
let trace = RpcTracing::method_call(&req.method);
let _enter = trace.span().enter();
rx_log_from_json(&req, call.max_log_length);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment