Semantic Conventions for JSON-RPC

Status: Experimental

The Semantic Conventions for JSON-RPC extend and override the RPC spans and RPC metrics Semantic Conventions that describe common RPC operations attributes in addition to the Semantic Conventions described on this page.

JSON-RPC Attributes

rpc.system MUST be set to "jsonrpc".

AttributeTypeDescriptionExamplesRequirement Level
rpc.jsonrpc.error_codeinterror.code property of response if it is an error response.-32700; 100Conditionally Required: If response is not successful.
rpc.jsonrpc.error_messagestringerror.message property of response if it is an error response.Parse error; User already existsRecommended
rpc.jsonrpc.request_idstringid property of request or response. Since protocol allows id to be int, string, null or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of null value. Omit entirely if this is a notification.10; request-7; ``Recommended
rpc.jsonrpc.versionstringProtocol version as in jsonrpc property of request/response. Since JSON-RPC 1.0 doesn’t specify this, the value can be omitted.2.0; 1.0Conditionally Required: If other than the default version (1.0)
rpc.methodstringThe name of the (logical) method being called, must be equal to the $method part in the span name. [1]exampleMethodRequired

[1]: This is always required for jsonrpc. See the note in the general RPC conventions for more information.