Semantic conventions for RPC events

Status: Development

This document defines events applicable in the context of remote procedure calls.

Message event

Status: Development

The event name MUST be rpc.message.

Describes a message sent or received within the context of an RPC call.

In the lifetime of an RPC stream, an event for each message sent/received on client and server spans SHOULD be created. In case of unary calls message events SHOULD NOT be recorded.

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
rpc.message.compressed_sizeDevelopmentRecommendedintCompressed size of the message in bytes.
rpc.message.idDevelopmentRecommendedintMUST be calculated as two different counters starting from 1 one for sent messages and one for received message. [1]
rpc.message.typeDevelopmentRecommendedstringWhether this is a received or sent message.SENT; RECEIVED
rpc.message.uncompressed_sizeDevelopmentRecommendedintUncompressed size of the message in bytes.

[1] rpc.message.id: This way we guarantee that the values will be consistent between different implementations.


rpc.message.type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
RECEIVEDreceivedDevelopment
SENTsentDevelopment