rpc.* and jsonrpc.* attributes: OpenTelemetry RPC conventions

From semantic-conventions v1.44.0 (e10a930)Synced View as MarkdownOpen in ClaudeOpen in ChatGPT

Short answer

The rpc.* attributes describe one remote procedure call: rpc.system.name says which protocol (grpc, jsonrpc and others), rpc.method names the method and rpc.response.status_code holds the returned code. jsonrpc.* adds the JSON-RPC protocol version and request id. The core rpc.* attributes are Release candidate in v1.44.0.

What do the rpc.* and jsonrpc.* attributes describe?

A call to an Ethereum node is JSON-RPC: eth_sendRawTransaction, eth_getTransactionReceipt and so on. Under the RPC conventions, each call is a CLIENT span named after rpc.method, with rpc.system.name set to jsonrpc.

If the method is unknown, rpc.method is _OTHER and the span is named after rpc.system.name instead. An error response puts its error.code in rpc.response.status_code, as a string.

Which spans set them?

Every span in the conventions that references at least one of these attributes, with the span name it should get and its kind.

  • {rpc.method}CLIENTrpc.call.client
  • {rpc.method}SERVERrpc.call.server
  • {rpc.method}CLIENTrpc.connect_rpc.call.client
  • {rpc.method}SERVERrpc.connect_rpc.call.server
  • {rpc.method}CLIENTrpc.grpc.call.client
  • {rpc.method}SERVERrpc.grpc.call.server
  • {rpc.method}CLIENTrpc.jsonrpc.call.client
  • {rpc.method}SERVERrpc.jsonrpc.call.server
  • {rpc.method}CLIENTrpc.dubbo.call.client
  • {rpc.method}SERVERrpc.dubbo.call.server
  • {mcp.method.name}CLIENTmcp.client
  • {mcp.method.name}SERVERmcp.server

What does a real span record?

eth_fillTransactionCLIENT
AttributeValue
rpc.system.namejsonrpc
rpc.methodeth_fillTransaction
jsonrpc.protocol.version2.0
server.address127.0.0.1
server.port8545
blockchain.chain.id31337
From a real run on 2026-10-18: @hashspan/viem 1.1.1 with viem 2.57.7 against a local Anvil node on port 8545. The page this run is from.

Its parent was send 31337, the transaction span. blockchain.chain.id is hashspan's own attribute, not part of the RPC conventions.

Should a JSON-RPC client record rpc.method?

The JSON-RPC conventions say a general-purpose instrumentation SHOULD NOT set rpc.method by default, because a server can be sent any method name. They make it opt-in.

hashspan records it on every JSON-RPC span its viem transport creates, with the span named after the method. A name that is not a plain identifier (a letter, then up to 63 letters, digits or underscores) goes in as _OTHER, and the span is then named jsonrpc, its rpc.system.name (since hashspan 1.3).

All 6 rpc.* attributes

rpc.method

stringRelease candidate

The fully-qualified logical name of the method from the RPC interface perspective.

Examples com.example.ExampleService/exampleMethod, EchoService/Echo, _OTHER

Set on
  • {rpc.method} CLIENT: rpc.call.client (conditionally required), rpc.connect_rpc.call.client (conditionally required), rpc.grpc.call.client (required), rpc.jsonrpc.call.client (opt-in), rpc.dubbo.call.client (required)
  • {rpc.method} SERVER: rpc.call.server (conditionally required), rpc.connect_rpc.call.server (conditionally required), rpc.grpc.call.server (conditionally required), rpc.jsonrpc.call.server (opt-in), rpc.dubbo.call.server (conditionally required)

Official definition

rpc.method_original

stringRelease candidate

The original name of the method used by the client.

Examples com.myservice.EchoService/catchAll, com.myservice.EchoService/unknownMethod, InvalidMethod

Set on
  • {rpc.method} CLIENT: rpc.call.client (conditionally required), rpc.connect_rpc.call.client (conditionally required), rpc.grpc.call.client (conditionally required), rpc.jsonrpc.call.client (conditionally required), rpc.dubbo.call.client (conditionally required)
  • {rpc.method} SERVER: rpc.call.server (conditionally required), rpc.connect_rpc.call.server (conditionally required), rpc.grpc.call.server (conditionally required), rpc.jsonrpc.call.server (conditionally required), rpc.dubbo.call.server (conditionally required)

Official definition

rpc.request.metadata.<key>

string[]Development

RPC request metadata, <key> being the normalized RPC metadata key (lowercase), the value being the metadata values.

Examples ["1.2.3.4","1.2.3.5"]

Set on
  • {rpc.method} CLIENT: rpc.connect_rpc.call.client (opt-in), rpc.grpc.call.client (opt-in), rpc.dubbo.call.client (opt-in)
  • {rpc.method} SERVER: rpc.connect_rpc.call.server (opt-in), rpc.grpc.call.server (opt-in), rpc.dubbo.call.server (opt-in)

Official definition

rpc.response.metadata.<key>

string[]Development

RPC response metadata, <key> being the normalized RPC metadata key (lowercase), the value being the metadata values.

Examples ["attribute_value"]

Set on
  • {rpc.method} CLIENT: rpc.connect_rpc.call.client (opt-in), rpc.grpc.call.client (opt-in), rpc.dubbo.call.client (opt-in)
  • {rpc.method} SERVER: rpc.connect_rpc.call.server (opt-in), rpc.grpc.call.server (opt-in), rpc.dubbo.call.server (opt-in)

Official definition

rpc.response.status_code

stringRelease candidate

Status code of the RPC returned by the RPC server or generated by the client

Examples OK, DEADLINE_EXCEEDED, -32602

Set on
  • {rpc.method} CLIENT: rpc.call.client (conditionally required), rpc.connect_rpc.call.client (conditionally required), rpc.grpc.call.client (required), rpc.jsonrpc.call.client (conditionally required), rpc.dubbo.call.client (required)
  • {rpc.method} SERVER: rpc.call.server (conditionally required), rpc.connect_rpc.call.server (conditionally required), rpc.grpc.call.server (required), rpc.jsonrpc.call.server (conditionally required), rpc.dubbo.call.server (required)
  • {mcp.method.name} CLIENT: mcp.client (conditionally required)
  • {mcp.method.name} SERVER: mcp.server (conditionally required)

Official definition

rpc.system.name

stringRelease candidate

The Remote Procedure Call (RPC) system.

Values grpc, dubbo, connectrpc, jsonrpc

Set on
  • {rpc.method} CLIENT: rpc.call.client (required)
  • {rpc.method} SERVER: rpc.call.server (required)

Official definition

All 2 jsonrpc.* attributes

jsonrpc.protocol.version

stringDevelopment

Protocol version, as specified in the jsonrpc property of the request and its corresponding response.

Examples 2.0, 1.0

Set on
  • {rpc.method} CLIENT: rpc.jsonrpc.call.client (conditionally required)
  • {rpc.method} SERVER: rpc.jsonrpc.call.server (conditionally required)
  • {mcp.method.name} CLIENT: mcp.client (recommended)
  • {mcp.method.name} SERVER: mcp.server (recommended)

Official definition

jsonrpc.request.id

stringDevelopment

A string representation of the id property of the request and its corresponding response.

Examples 10, request-7

Set on
  • {rpc.method} CLIENT: rpc.jsonrpc.call.client (recommended)
  • {rpc.method} SERVER: rpc.jsonrpc.call.server (recommended)
  • {mcp.method.name} CLIENT: mcp.client (conditionally required)
  • {mcp.method.name} SERVER: mcp.server (conditionally required)

Official definition

Which names were renamed or removed?

Deprecated names you may still see in older traces, each with what replaced it.

rpc.connect_rpc.error_code

stringDeprecated

Renamed to rpc.response.status_code.

Values cancelled, unknown, invalid_argument, deadline_exceeded, not_found, already_exists, permission_denied, resource_exhausted, failed_precondition, aborted, out_of_range, unimplemented, internal, unavailable, data_loss, unauthenticated

Official definition

rpc.service

stringDeprecated

Value should be included in rpc.method which is expected to be a fully-qualified name.

Examples myservice.EchoService

Official definition

rpc.system

stringDeprecated

Renamed to rpc.system.name.

Values grpc, java_rmi, dotnet_wcf, apache_dubbo, connect_rpc, onc_rpc, jsonrpc

Official definition

FAQ

What replaced rpc.system and rpc.service?

rpc.system was renamed to rpc.system.name. rpc.service is gone: its value is now part of a fully qualified rpc.method, such as com.example.ExampleService/exampleMethod.

Where does a JSON-RPC error code go?

In rpc.response.status_code, as a string. The older rpc.jsonrpc.error_code attribute is deprecated, and rpc.jsonrpc.error_message gave way to the span status description.

Attribute names, types, stability and descriptions are from the OpenTelemetry semantic conventions (open-telemetry/semantic-conventions), © OpenTelemetry Authors, Apache-2.0. Each attribute links to its official definition, which wins where the two differ.

Something wrong or out of date? Report a problem with this page.

Type to search the docs, Learn topics and the blog.