Semantic conventions for Connect RPC

Status: Development

The Semantic Conventions for Connect 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.

Connect RPC Attributes

rpc.system MUST be set to "connect_rpc".

Below is a table of attributes that SHOULD be included on client and server Connect RPC measurements.

AttributeTypeDescriptionExamplesRequirement LevelStability
rpc.connect_rpc.error_codestringThe error codes of the Connect request. Error codes are always string values.cancelled; unknown; invalid_argumentConditionally Required [1]Development
rpc.connect_rpc.request.metadata.<key>string[]Connect request metadata, <key> being the normalized Connect Metadata key (lowercase), the value being the metadata values. [2]rpc.request.metadata.my-custom-metadata-attribute=["1.2.3.4", "1.2.3.5"]Opt-InDevelopment
rpc.connect_rpc.response.metadata.<key>string[]Connect response metadata, <key> being the normalized Connect Metadata key (lowercase), the value being the metadata values. [3]rpc.response.metadata.my-custom-metadata-attribute=["attribute_value"]Opt-InDevelopment

[1] rpc.connect_rpc.error_code: If response is not successful and if error code available.

[2] rpc.connect_rpc.request.metadata: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information.

[3] rpc.connect_rpc.response.metadata: Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information.


rpc.connect_rpc.error_code 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
abortedabortedDevelopment
already_existsalready_existsDevelopment
cancelledcancelledDevelopment
data_lossdata_lossDevelopment
deadline_exceededdeadline_exceededDevelopment
failed_preconditionfailed_preconditionDevelopment
internalinternalDevelopment
invalid_argumentinvalid_argumentDevelopment
not_foundnot_foundDevelopment
out_of_rangeout_of_rangeDevelopment
permission_deniedpermission_deniedDevelopment
resource_exhaustedresource_exhaustedDevelopment
unauthenticatedunauthenticatedDevelopment
unavailableunavailableDevelopment
unimplementedunimplementedDevelopment
unknownunknownDevelopment

Connect RPC Status

If rpc.connect_rpc.error_code is set, Span Status MUST be set to Error and left unset in all other cases.