Skip to content

Commit cac1292

Browse files
joshcarparminru
andauthored
Add Connect RPC to semantic conventions (open-telemetry#3116)
* Add connect_rpc to rpc.yaml * Add connect rpc into rpc-metrics and rpc markdown * Add Connect RPC change to CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: Armin Ruech <[email protected]>
1 parent 99d2fca commit cac1292

File tree

4 files changed

+150
-0
lines changed

4 files changed

+150
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ release.
2828
([#3209](https://github.com/open-telemetry/opentelemetry-specification/pull/3209))
2929
- BREAKING: Change faas.max_memory units to Bytes instead of MB
3030
([#3209](https://github.com/open-telemetry/opentelemetry-specification/pull/3209))
31+
- Add Connect RPC specific conventions
32+
([#3116](https://github.com/open-telemetry/opentelemetry-specification/pull/3116))
3133

3234
### Compatibility
3335

semantic_conventions/trace/rpc.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ groups:
2323
- id: apache_dubbo
2424
value: 'apache_dubbo'
2525
brief: 'Apache Dubbo'
26+
- id: connect_rpc
27+
value: 'connect_rpc'
28+
brief: 'Connect RPC'
2629
- id: service
2730
type: string
2831
requirement_level: recommended
@@ -210,3 +213,48 @@ groups:
210213
- id: uncompressed_size
211214
type: int
212215
brief: "Uncompressed size of the message in bytes."
216+
217+
- id: rpc.connect_rpc
218+
prefix: rpc.connect_rpc
219+
type: span
220+
extends: rpc
221+
brief: 'Tech-specific attributes for Connect RPC.'
222+
attributes:
223+
- id: error_code
224+
type:
225+
members:
226+
- id: cancelled
227+
value: cancelled
228+
- id: unknown
229+
value: unknown
230+
- id: invalid_argument
231+
value: invalid_argument
232+
- id: deadline_exceeded
233+
value: deadline_exceeded
234+
- id: not_found
235+
value: not_found
236+
- id: already_exists
237+
value: already_exists
238+
- id: permission_denied
239+
value: permission_denied
240+
- id: resource_exhausted
241+
value: resource_exhausted
242+
- id: failed_precondition
243+
value: failed_precondition
244+
- id: aborted
245+
value: aborted
246+
- id: out_of_range
247+
value: out_of_range
248+
- id: unimplemented
249+
value: unimplemented
250+
- id: internal
251+
value: internal
252+
- id: unavailable
253+
value: unavailable
254+
- id: data_loss
255+
value: data_loss
256+
- id: unauthenticated
257+
value: unauthenticated
258+
requirement_level:
259+
conditionally_required: If response is not successful and if error code available.
260+
brief: "The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values."

specification/metrics/semantic_conventions/rpc-metrics.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ metrics can be filtered for finer grain analysis.
2323
* [Service name](#service-name)
2424
- [gRPC conventions](#grpc-conventions)
2525
* [gRPC Attributes](#grpc-attributes)
26+
- [Connect RPC conventions](#connect-rpc-conventions)
27+
* [Connect RPC Attributes](#connect-rpc-attributes)
2628

2729
<!-- tocstop -->
2830

@@ -100,6 +102,7 @@ measurements.
100102
| `java_rmi` | Java RMI |
101103
| `dotnet_wcf` | .NET WCF |
102104
| `apache_dubbo` | Apache Dubbo |
105+
| `connect_rpc` | Connect RPC |
103106
<!-- endsemconv -->
104107

105108
To avoid high cardinality, implementations should prefer the most stable of `net.peer.name` or
@@ -158,3 +161,42 @@ Below is a table of attributes that SHOULD be included on client and server RPC
158161
<!-- endsemconv -->
159162

160163
[gRPC]: https://grpc.io/
164+
165+
## Connect RPC conventions
166+
167+
For remote procedure calls via [connect](http://connect.build), additional conventions are described in this section.
168+
169+
`rpc.system` MUST be set to `"connect_rpc"`.
170+
171+
### Connect RPC Attributes
172+
173+
Below is a table of attributes that SHOULD be included on client and server RPC measurements when `rpc.system` is `"connect_rpc"`.
174+
175+
<!-- semconv rpc.connect_rpc -->
176+
| Attribute | Type | Description | Examples | Requirement Level |
177+
|---|---|---|---|---|
178+
| [`rpc.connect_rpc.error_code`](../../trace/semantic_conventions/rpc.md) | string | The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. | `cancelled` | Conditionally Required: [1] |
179+
180+
**[1]:** If response is not successful and if error code available.
181+
182+
`rpc.connect_rpc.error_code` MUST be one of the following:
183+
184+
| Value | Description |
185+
|---|---|
186+
| `cancelled` | cancelled |
187+
| `unknown` | unknown |
188+
| `invalid_argument` | invalid_argument |
189+
| `deadline_exceeded` | deadline_exceeded |
190+
| `not_found` | not_found |
191+
| `already_exists` | already_exists |
192+
| `permission_denied` | permission_denied |
193+
| `resource_exhausted` | resource_exhausted |
194+
| `failed_precondition` | failed_precondition |
195+
| `aborted` | aborted |
196+
| `out_of_range` | out_of_range |
197+
| `unimplemented` | unimplemented |
198+
| `internal` | internal |
199+
| `unavailable` | unavailable |
200+
| `data_loss` | data_loss |
201+
| `unauthenticated` | unauthenticated |
202+
<!-- endsemconv -->

specification/trace/semantic_conventions/rpc.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ This document defines how to describe remote procedure calls
2020
* [gRPC Attributes](#grpc-attributes)
2121
* [gRPC Status](#grpc-status)
2222
* [gRPC Request and Response Metadata](#grpc-request-and-response-metadata)
23+
- [Connect RPC conventions](#connect-rpc-conventions)
24+
* [Connect RPC Attributes](#connect-rpc-attributes)
25+
* [Connect RPC Status](#connect-rpc-status)
26+
* [Connect RPC Request and Response Metadata](#connect-rpc-request-and-response-metadata)
2327
- [JSON RPC](#json-rpc)
2428
* [JSON RPC Attributes](#json-rpc-attributes)
2529

@@ -92,6 +96,7 @@ Examples of span names:
9296
| `java_rmi` | Java RMI |
9397
| `dotnet_wcf` | .NET WCF |
9498
| `apache_dubbo` | Apache Dubbo |
99+
| `connect_rpc` | Connect RPC |
95100
<!-- endsemconv -->
96101

97102
For client-side spans `net.peer.port` is required if the connection is IP-based and the port is available (it describes the server port they are connecting to).
@@ -213,6 +218,59 @@ The [Span Status](../api.md#set-status) MUST be left unset for an `OK` gRPC stat
213218
**[1]:** Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured.
214219
Including all request/response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information.
215220

221+
## Connect RPC conventions
222+
223+
For remote procedure calls via [connect](http://connect.build), additional conventions are described in this section.
224+
225+
`rpc.system` MUST be set to `"connect_rpc"`.
226+
227+
### Connect RPC Attributes
228+
229+
Below is a table of attributes that SHOULD be included on client and server RPC measurements when `rpc.system` is `"connect_rpc"`.
230+
231+
<!-- semconv rpc.connect_rpc -->
232+
| Attribute | Type | Description | Examples | Requirement Level |
233+
|---|---|---|---|---|
234+
| `rpc.connect_rpc.error_code` | string | The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. | `cancelled` | Conditionally Required: [1] |
235+
236+
**[1]:** If response is not successful and if error code available.
237+
238+
`rpc.connect_rpc.error_code` MUST be one of the following:
239+
240+
| Value | Description |
241+
|---|---|
242+
| `cancelled` | cancelled |
243+
| `unknown` | unknown |
244+
| `invalid_argument` | invalid_argument |
245+
| `deadline_exceeded` | deadline_exceeded |
246+
| `not_found` | not_found |
247+
| `already_exists` | already_exists |
248+
| `permission_denied` | permission_denied |
249+
| `resource_exhausted` | resource_exhausted |
250+
| `failed_precondition` | failed_precondition |
251+
| `aborted` | aborted |
252+
| `out_of_range` | out_of_range |
253+
| `unimplemented` | unimplemented |
254+
| `internal` | internal |
255+
| `unavailable` | unavailable |
256+
| `data_loss` | data_loss |
257+
| `unauthenticated` | unauthenticated |
258+
<!-- endsemconv -->
259+
260+
### Connect RPC Status
261+
262+
If `rpc.connect_rpc.error_code` is set, [Span Status](../api.md#set-status) MUST be set to `Error` and left unset in all other cases.
263+
264+
### Connect RPC Request and Response Metadata
265+
266+
| Attribute | Type | Description | Examples | Requirement Level |
267+
|-------------------------------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------|-------------------|
268+
| `rpc.connect_rpc.request.metadata.<key>` | string[] | Connect request metadata, `<key>` being the normalized Connect Metadata key (lowercase, with `-` characters replaced by `_`), the value being the metadata values. [1] | `rpc.request.metadata.my_custom_metadata_attribute=["1.2.3.4", "1.2.3.5"]` | Optional |
269+
| `rpc.connect_rpc.response.metadata.<key>` | string[] | Connect response metadata, `<key>` being the normalized Connect Metadata key (lowercase, with `-` characters replaced by `_`), the value being the metadata values. [1] | `rpc.response.metadata.my_custom_metadata_attribute=["attribute_value"]` | Optional |
270+
271+
**[1]:** Instrumentations SHOULD require an explicit configuration of which metadata values are to be captured.
272+
Including all request/response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information.
273+
216274
## JSON RPC
217275

218276
Conventions specific to [JSON RPC](https://www.jsonrpc.org/).

0 commit comments

Comments
 (0)