-
Notifications
You must be signed in to change notification settings - Fork 330
Description
The jsonrpc conventions require the presence of rpc.method.
In some invalid request scenarios, it is impossible to determine the method trying to be invoked.
Like from the jsonrpc specification examples:
--> {"jsonrpc": "2.0", "method": "foobar, "params": "bar", "baz]
<-- {"jsonrpc": "2.0", "error": {"code": -32700, "message": "Parse error"}, "id": null}
Should there be a convention for the telemetry in this scenario?
I can imagine a few options:
- Don't generate metrics for this scenario
- Break convention and don't send
rpc.method - Send a special value for
rpc.methodlike"" - Make
rpc.methodconditionally required
I see value in counting how many jsonrpc errors with code -32700 my server returns.
I would be erring on option 3 to respect the convention.
Extra thoughts on option 3
Why "" ? the jsonspec requires a null on these errors:
If there was an error in detecting the id in the Request object (e.g. Parse error/Invalid Request), it MUST be Null.
And the semantic convention maps it to empty string
Use empty string in case of null value
It felt reasonable to follow the same results for when rpc.method can't be detected.
Metadata
Metadata
Assignees
Type
Projects
Status