Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add connect to rpc.yaml #2950

Closed
wants to merge 12 commits into from
48 changes: 48 additions & 0 deletions semantic_conventions/trace/rpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ groups:
- id: apache_dubbo
value: 'apache_dubbo'
brief: 'Apache Dubbo'
- id: buf_connect
value: 'buf_connect'
brief: 'Buf Connect'
- id: service
type: string
requirement_level: recommended
Expand Down Expand Up @@ -210,3 +213,48 @@ groups:
- id: uncompressed_size
type: int
brief: "Uncompressed size of the message in bytes."

- id: rpc.buf_connect
prefix: rpc.buf_connect
joshcarp marked this conversation as resolved.
Show resolved Hide resolved
type: span
extends: rpc
brief: 'Tech-specific attributes for Connect.'
attributes:
- id: error_code
joshcarp marked this conversation as resolved.
Show resolved Hide resolved
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
Comment on lines +226 to +257
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you say why this section looks different than the gRPC section above which also includes a "brief" attribute? This also looks unnecessarily duplicated -- can we instead refer to the gRPC section above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is unnecessarily duplicated but the generator needs to have both an key/id and a value. They're similar to grpc but different because all connect error codes are strings, not ints

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."
40 changes: 40 additions & 0 deletions specification/metrics/semantic_conventions/rpc-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ measurements.
| `java_rmi` | Java RMI |
| `dotnet_wcf` | .NET WCF |
| `apache_dubbo` | Apache Dubbo |
| `buf_connect` | Buf Connect |
<!-- endsemconv -->

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

[gRPC]: https://grpc.io/

## Connect conventions

For remote procedure calls via [connect](http://connect.build), additional conventions are described in this section.

`rpc.system` MUST be set to `"buf_connect"`.

### Connect Attributes

Below is a table of attributes that SHOULD be included on client and server RPC measurements when `rpc.system` is `"buf_connect"`.

<!-- semconv rpc.buf_connect -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `rpc.buf_connect.error_code` | string | The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. | `cancelled` | Conditionally Required: [1] |

**[1]:** If response is not successful and if error code available.

`rpc.buf_connect.error_code` MUST be one of the following:

| Value | Description |
|---|---|
| `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 |
<!-- endsemconv -->
1 change: 1 addition & 0 deletions specification/trace/semantic_conventions/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Examples of span names:
| `java_rmi` | Java RMI |
| `dotnet_wcf` | .NET WCF |
| `apache_dubbo` | Apache Dubbo |
| `buf_connect` | Buf Connect |
<!-- endsemconv -->

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).
Expand Down