Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
jsonrpsee
Commits
ffb1fc41
Commit
ffb1fc41
authored
Jul 28, 2022
by
patrick
Browse files
Revert "add id to tracing span"
This reverts commit
5e01e6be
.
parent
5e01e6be
Changes
5
Show whitespace changes
Inline
Side-by-side
client/http-client/src/client.rs
View file @
ffb1fc41
...
...
@@ -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
)
?
;
...
...
core/src/client/async_client/mod.rs
View file @
ffb1fc41
...
...
@@ -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
)
?
;
...
...
core/src/tracing.rs
View file @
ffb1fc41
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.
...
...
http-server/src/server.rs
View file @
ffb1fc41
...
...
@@ -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
);
...
...
ws-server/src/server.rs
View file @
ffb1fc41
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment