-
Notifications
You must be signed in to change notification settings - Fork 174
/
rpc.yaml
263 lines (257 loc) · 9.3 KB
/
rpc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
groups:
- id: rpc
prefix: rpc
type: span
brief: 'This document defines semantic conventions for remote procedure calls.'
events: [rpc.message]
attributes:
- id: system
requirement_level: required
brief: 'A string identifying the remoting system. See below for a list of well-known identifiers.'
type:
allow_custom_values: true
members:
- id: grpc
value: 'grpc'
brief: 'gRPC'
- id: java_rmi
value: 'java_rmi'
brief: 'Java RMI'
- id: dotnet_wcf
value: 'dotnet_wcf'
brief: '.NET WCF'
- id: apache_dubbo
value: 'apache_dubbo'
brief: 'Apache Dubbo'
- id: connect_rpc
value: 'connect_rpc'
brief: 'Connect RPC'
- id: service
type: string
requirement_level: recommended
brief: 'The full (logical) name of the service being called, including its package name, if applicable.'
note: >
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"
- id: method
type: string
requirement_level: recommended
brief: 'The name of the (logical) method being called, must be equal to the $method part in the span name.'
note: >
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"
- ref: server.socket.address
- ref: server.socket.port
requirement_level:
recommended: If different than `server.port` and if `server.socket.address` is set.
- ref: network.transport
- ref: network.type
- ref: server.address
requirement_level: required
brief: >
RPC server [host name](https://grpc.github.io/grpc/core/md_doc_naming.html).
note: >
May contain server IP address, DNS name, or local socket name. When host component is an IP address,
instrumentations SHOULD NOT do a reverse proxy lookup to obtain DNS name and SHOULD set
`server.address` to the IP address provided in the host component.
- ref: server.port
requirement_level:
conditionally_required: See below
constraints:
- any_of:
- server.socket.address
- server.address
- id: rpc.client
type: span
brief: 'This document defines semantic conventions for remote procedure call client spans.'
extends: rpc
attributes:
- ref: server.socket.domain
requirement_level:
recommended: If different than `server.address` and if `server.socket.address` is set.
- id: rpc.server
prefix: rpc
type: span
extends: rpc
span_kind: server
brief: 'Semantic Convention for RPC server spans'
attributes:
- ref: client.address
- ref: client.port
- ref: client.socket.address
- ref: client.socket.port
- ref: network.transport
- ref: network.type
- id: rpc.grpc
prefix: rpc.grpc
type: span
extends: rpc
brief: 'Tech-specific attributes for gRPC.'
attributes:
- id: status_code
type:
members:
- id: ok
brief: OK
value: 0
- id: cancelled
brief: CANCELLED
value: 1
- id: unknown
brief: UNKNOWN
value: 2
- id: invalid_argument
brief: INVALID_ARGUMENT
value: 3
- id: deadline_exceeded
brief: DEADLINE_EXCEEDED
value: 4
- id: not_found
brief: NOT_FOUND
value: 5
- id: already_exists
brief: ALREADY_EXISTS
value: 6
- id: permission_denied
brief: PERMISSION_DENIED
value: 7
- id: resource_exhausted
brief: RESOURCE_EXHAUSTED
value: 8
- id: failed_precondition
brief: FAILED_PRECONDITION
value: 9
- id: aborted
brief: ABORTED
value: 10
- id: out_of_range
brief: OUT_OF_RANGE
value: 11
- id: unimplemented
brief: UNIMPLEMENTED
value: 12
- id: internal
brief: INTERNAL
value: 13
- id: unavailable
brief: UNAVAILABLE
value: 14
- id: data_loss
brief: DATA_LOSS
value: 15
- id: unauthenticated
brief: UNAUTHENTICATED
value: 16
requirement_level: required
brief: "The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request."
- id: rpc.jsonrpc
prefix: rpc.jsonrpc
type: span
extends: rpc
brief: 'Tech-specific attributes for [JSON RPC](https://www.jsonrpc.org/).'
attributes:
- id: version
type: string
requirement_level:
conditionally_required: If other than the default version (`1.0`)
brief: "Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted."
examples: ['2.0', '1.0']
- id: request_id
type: string
brief: >
`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.
examples: ['10', 'request-7', '']
- id: error_code
type: int
requirement_level:
conditionally_required: If response is not successful.
brief: "`error.code` property of response if it is an error response."
examples: [-32700, 100]
- id: error_message
type: string
brief: "`error.message` property of response if it is an error response."
examples: ['Parse error', 'User already exists']
- ref: rpc.method
requirement_level: required
note: >
This is always required for jsonrpc. See the note in the general
RPC conventions for more information.
- id: rpc.message
prefix: "message" # TODO: Change the prefix to rpc.message?
type: event
brief: "RPC received/sent message."
attributes:
- id: type
type:
members:
- id: sent
value: "SENT"
- id: received
value: "RECEIVED"
brief: "Whether this is a received or sent message."
- id: id
type: int
brief: "MUST be calculated as two different counters starting from `1` one for sent messages and one for received message."
note: "This way we guarantee that the values will be consistent between different implementations."
- id: compressed_size
type: int
brief: "Compressed size of the message in bytes."
- id: uncompressed_size
type: int
brief: "Uncompressed size of the message in bytes."
- id: rpc.connect_rpc
prefix: rpc.connect_rpc
type: span
extends: rpc
brief: 'Tech-specific attributes for Connect RPC.'
attributes:
- id: error_code
type:
members:
- id: cancelled
value: cancelled
- id: unknown
value: unknown
- id: invalid_argument
value: invalid_argument
- id: deadline_exceeded
value: deadline_exceeded
- id: not_found
value: not_found
- id: already_exists
value: already_exists
- id: permission_denied
value: permission_denied
- id: resource_exhausted
value: resource_exhausted
- id: failed_precondition
value: failed_precondition
- id: aborted
value: aborted
- id: out_of_range
value: out_of_range
- id: unimplemented
value: unimplemented
- id: internal
value: internal
- id: unavailable
value: unavailable
- id: data_loss
value: data_loss
- id: unauthenticated
value: unauthenticated
requirement_level:
conditionally_required: If response is not successful and if error code available.
brief: "The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values."