View Source OpenTelemetry.SemConv.Incubating.RPCAttributes (OpenTelemetry.SemConv v1.27.0)
OpenTelemetry Semantic Conventions for RPC attributes.
Summary
Types
Deprecated, use rpc.message.type
instead.
The error codes of the Connect request. Error codes are always string values.
The numeric status code of the gRPC request.
Whether this is a received or sent message.
A string identifying the remoting system. See below for a list of well-known identifiers.
Functions
The error codes of the Connect request. Error codes are always string values.
Connect request metadata, <key>
being the normalized Connect Metadata key (lowercase), the value being the metadata values.
Connect response metadata, <key>
being the normalized Connect Metadata key (lowercase), the value being the metadata values.
gRPC request metadata, <key>
being the normalized gRPC Metadata key (lowercase), the value being the metadata values.
gRPC response metadata, <key>
being the normalized gRPC Metadata key (lowercase), the value being the metadata values.
The numeric status code of the gRPC request.
error.code
property of response if it is an error response.
error.message
property of response if it is an error response.
id
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.
Protocol version as in jsonrpc
property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted.
Compressed size of the message in bytes.
MUST be calculated as two different counters starting from 1
one for sent messages and one for received message.
Whether this is a received or sent message.
Uncompressed size of the message in bytes.
The name of the (logical) method being called, must be equal to the $method part in the span name.
The full (logical) name of the service being called, including its package name, if applicable.
A string identifying the remoting system. See below for a list of well-known identifiers.
Types
@type message_type_values() :: %{sent: :SENT, received: :RECEIVED}
Deprecated, use rpc.message.type
instead.
Enum Values
@type rpc_connect_rpc_error_code_values() :: %{
cancelled: :cancelled,
unknown: :unknown,
invalid_argument: :invalid_argument,
deadline_exceeded: :deadline_exceeded,
not_found: :not_found,
already_exists: :already_exists,
permission_denied: :permission_denied,
resource_exhausted: :resource_exhausted,
failed_precondition: :failed_precondition,
aborted: :aborted,
out_of_range: :out_of_range,
unimplemented: :unimplemented,
internal: :internal,
unavailable: :unavailable,
data_loss: :data_loss,
unauthenticated: :unauthenticated
}
The error codes of the Connect request. Error codes are always string values.
Enum Values
@type rpc_grpc_status_code_values() :: %{
ok: 0,
cancelled: 1,
unknown: 2,
invalid_argument: 3,
deadline_exceeded: 4,
not_found: 5,
already_exists: 6,
permission_denied: 7,
resource_exhausted: 8,
failed_precondition: 9,
aborted: 10,
out_of_range: 11,
unimplemented: 12,
internal: 13,
unavailable: 14,
data_loss: 15,
unauthenticated: 16
}
The numeric status code of the gRPC request.
Enum Values
:ok
e - OK:cancelled
e - CANCELLED:unknown
e - UNKNOWN:invalid_argument
e - INVALID_ARGUMENT:deadline_exceeded
e - DEADLINE_EXCEEDED:not_found
e - NOT_FOUND:already_exists
e - ALREADY_EXISTS:permission_denied
e - PERMISSION_DENIED:resource_exhausted
e - RESOURCE_EXHAUSTED:failed_precondition
e - FAILED_PRECONDITION:aborted
e - ABORTED:out_of_range
e - OUT_OF_RANGE:unimplemented
e - UNIMPLEMENTED:internal
e - INTERNAL:unavailable
e - UNAVAILABLE:data_loss
e - DATA_LOSS:unauthenticated
e - UNAUTHENTICATED
@type rpc_message_type_values() :: %{sent: :SENT, received: :RECEIVED}
Whether this is a received or sent message.
Enum Values
@type rpc_system_values() :: %{
grpc: :grpc,
java_rmi: :java_rmi,
dotnet_wcf: :dotnet_wcf,
apache_dubbo: :apache_dubbo,
connect_rpc: :connect_rpc
}
A string identifying the remoting system. See below for a list of well-known identifiers.
Enum Values
Functions
@spec message_compressed_size() :: :"message.compressed_size"
@spec message_id() :: :"message.id"
@spec message_type() :: :"message.type"
@spec message_type_values() :: message_type_values()
@spec message_uncompressed_size() :: :"message.uncompressed_size"
@spec rpc_connect_rpc_error_code() :: :"rpc.connect_rpc.error_code"
The error codes of the Connect request. Error codes are always string values.
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_connect_rpc_error_code()
:"rpc.connect_rpc.error_code"
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_connect_rpc_error_code_values().cancelled
:cancelled
iex> %{OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_connect_rpc_error_code() => OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_connect_rpc_error_code_values().cancelled}
%{:"rpc.connect_rpc.error_code" => :cancelled}
?RPC_CONNECT_RPC_ERROR_CODE.
'rpc.connect_rpc.error_code'
?RPC_CONNECT_RPC_ERROR_CODE_VALUES_CANCELLED.
'cancelled'
#{?RPC_CONNECT_RPC_ERROR_CODE => ?RPC_CONNECT_RPC_ERROR_CODE_VALUES_CANCELLED}.
#{'rpc.connect_rpc.error_code' => 'cancelled'}
@spec rpc_connect_rpc_error_code_values() :: rpc_connect_rpc_error_code_values()
@spec rpc_connect_rpc_request_metadata() :: :"rpc.connect_rpc.request.metadata"
Connect request metadata, <key>
being the normalized Connect Metadata key (lowercase), the value being the metadata values.
Value type
Value must be of type [atom() | String.t()]
.
Notes
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.
Examples
["rpc.request.metadata.my-custom-metadata-attribute=["1.2.3.4", "1.2.3.5"]"]
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_connect_rpc_request_metadata()
:"rpc.connect_rpc.request.metadata"
?RPC_CONNECT_RPC_REQUEST_METADATA.
'rpc.connect_rpc.request.metadata'
@spec rpc_connect_rpc_response_metadata() :: :"rpc.connect_rpc.response.metadata"
Connect response metadata, <key>
being the normalized Connect Metadata key (lowercase), the value being the metadata values.
Value type
Value must be of type [atom() | String.t()]
.
Notes
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.
Examples
["rpc.response.metadata.my-custom-metadata-attribute=["attribute_value"]"]
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_connect_rpc_response_metadata()
:"rpc.connect_rpc.response.metadata"
?RPC_CONNECT_RPC_RESPONSE_METADATA.
'rpc.connect_rpc.response.metadata'
@spec rpc_grpc_request_metadata() :: :"rpc.grpc.request.metadata"
gRPC request metadata, <key>
being the normalized gRPC Metadata key (lowercase), the value being the metadata values.
Value type
Value must be of type [atom() | String.t()]
.
Notes
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.
Examples
["rpc.grpc.request.metadata.my-custom-metadata-attribute=["1.2.3.4", "1.2.3.5"]"]
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_grpc_request_metadata()
:"rpc.grpc.request.metadata"
?RPC_GRPC_REQUEST_METADATA.
'rpc.grpc.request.metadata'
@spec rpc_grpc_response_metadata() :: :"rpc.grpc.response.metadata"
gRPC response metadata, <key>
being the normalized gRPC Metadata key (lowercase), the value being the metadata values.
Value type
Value must be of type [atom() | String.t()]
.
Notes
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.
Examples
["rpc.grpc.response.metadata.my-custom-metadata-attribute=["attribute_value"]"]
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_grpc_response_metadata()
:"rpc.grpc.response.metadata"
?RPC_GRPC_RESPONSE_METADATA.
'rpc.grpc.response.metadata'
@spec rpc_grpc_status_code() :: :"rpc.grpc.status_code"
The numeric status code of the gRPC request.
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_grpc_status_code()
:"rpc.grpc.status_code"
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_grpc_status_code_values().ok
0
iex> %{OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_grpc_status_code() => OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_grpc_status_code_values().ok}
%{:"rpc.grpc.status_code" => 0}
?RPC_GRPC_STATUS_CODE.
'rpc.grpc.status_code'
?RPC_GRPC_STATUS_CODE_VALUES_OK.
'0'
#{?RPC_GRPC_STATUS_CODE => ?RPC_GRPC_STATUS_CODE_VALUES_OK}.
#{'rpc.grpc.status_code' => '0'}
@spec rpc_grpc_status_code_values() :: rpc_grpc_status_code_values()
@spec rpc_jsonrpc_error_code() :: :"rpc.jsonrpc.error_code"
error.code
property of response if it is an error response.
Value type
Value must be of type integer()
.
Examples
[-32700, 100]
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_jsonrpc_error_code()
:"rpc.jsonrpc.error_code"
?RPC_JSONRPC_ERROR_CODE.
'rpc.jsonrpc.error_code'
@spec rpc_jsonrpc_error_message() :: :"rpc.jsonrpc.error_message"
error.message
property of response if it is an error response.
Value type
Value must be of type atom() | String.t()
.
Examples
["Parse error", "User already exists"]
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_jsonrpc_error_message()
:"rpc.jsonrpc.error_message"
?RPC_JSONRPC_ERROR_MESSAGE.
'rpc.jsonrpc.error_message'
@spec rpc_jsonrpc_request_id() :: :"rpc.jsonrpc.request_id"
id
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.
Value type
Value must be of type atom() | String.t()
.
Examples
["10", "request-7", ""]
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_jsonrpc_request_id()
:"rpc.jsonrpc.request_id"
?RPC_JSONRPC_REQUEST_ID.
'rpc.jsonrpc.request_id'
@spec rpc_jsonrpc_version() :: :"rpc.jsonrpc.version"
Protocol version as in jsonrpc
property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted.
Value type
Value must be of type atom() | String.t()
.
Examples
["2.0", "1.0"]
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_jsonrpc_version()
:"rpc.jsonrpc.version"
?RPC_JSONRPC_VERSION.
'rpc.jsonrpc.version'
@spec rpc_message_compressed_size() :: :"rpc.message.compressed_size"
Compressed size of the message in bytes.
Value type
Value must be of type integer()
.
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_message_compressed_size()
:"rpc.message.compressed_size"
?RPC_MESSAGE_COMPRESSED_SIZE.
'rpc.message.compressed_size'
@spec rpc_message_id() :: :"rpc.message.id"
MUST be calculated as two different counters starting from 1
one for sent messages and one for received message.
Value type
Value must be of type integer()
.
Notes
This way we guarantee that the values will be consistent between different implementations.
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_message_id()
:"rpc.message.id"
?RPC_MESSAGE_ID.
'rpc.message.id'
@spec rpc_message_type() :: :"rpc.message.type"
Whether this is a received or sent message.
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_message_type()
:"rpc.message.type"
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_message_type_values().sent
:SENT
iex> %{OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_message_type() => OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_message_type_values().sent}
%{:"rpc.message.type" => :SENT}
?RPC_MESSAGE_TYPE.
'rpc.message.type'
?RPC_MESSAGE_TYPE_VALUES_SENT.
'SENT'
#{?RPC_MESSAGE_TYPE => ?RPC_MESSAGE_TYPE_VALUES_SENT}.
#{'rpc.message.type' => 'SENT'}
@spec rpc_message_type_values() :: rpc_message_type_values()
@spec rpc_message_uncompressed_size() :: :"rpc.message.uncompressed_size"
Uncompressed size of the message in bytes.
Value type
Value must be of type integer()
.
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_message_uncompressed_size()
:"rpc.message.uncompressed_size"
?RPC_MESSAGE_UNCOMPRESSED_SIZE.
'rpc.message.uncompressed_size'
@spec rpc_method() :: :"rpc.method"
The name of the (logical) method being called, must be equal to the $method part in the span name.
Value type
Value must be of type atom() | String.t()
.
Notes
This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The code.function
attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side).
Examples
exampleMethod
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_method()
:"rpc.method"
?RPC_METHOD.
'rpc.method'
@spec rpc_service() :: :"rpc.service"
The full (logical) name of the service being called, including its package name, if applicable.
Value type
Value must be of type atom() | String.t()
.
Notes
This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The code.namespace
attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side).
Examples
myservice.EchoService
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_service()
:"rpc.service"
?RPC_SERVICE.
'rpc.service'
@spec rpc_system() :: :"rpc.system"
A string identifying the remoting system. See below for a list of well-known identifiers.
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_system()
:"rpc.system"
iex> OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_system_values().grpc
:grpc
iex> %{OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_system() => OpenTelemetry.SemConv.Incubating.RPCAttributes.rpc_system_values().grpc}
%{:"rpc.system" => :grpc}
?RPC_SYSTEM.
'rpc.system'
?RPC_SYSTEM_VALUES_GRPC.
'grpc'
#{?RPC_SYSTEM => ?RPC_SYSTEM_VALUES_GRPC}.
#{'rpc.system' => 'grpc'}
@spec rpc_system_values() :: rpc_system_values()