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 rpc.grpc.status_code attribute to rpc metric semantic conventions #2604

Merged
merged 14 commits into from
Jun 30, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 40 additions & 5 deletions specification/metrics/semantic_conventions/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
**Status**: [Experimental](../../document-status.md)
jack-berg marked this conversation as resolved.
Show resolved Hide resolved

The conventions described in this section are RPC specific. When RPC operations
occur, metric events about those operations will be generated and reported to
provide insight into those operations. By adding RPC properties as attributes
on metric events it allows for finely tuned filtering.
occur, measurements about those operations are recorded to instruments. The
measurements are aggregated and exported as metrics, which provide insight into
those operations. By including RPC properties as attributes on measurements, the
metrics can be filtered for finer grain analysis.

<!-- Re-generate TOC with `markdown-toc --no-first-h1 -i` -->

Expand Down Expand Up @@ -54,8 +55,8 @@ RPC usage, not streaming RPCs.

## Attributes

Below is a table of attributes that SHOULD be included on metric events and whether
or not they should be on the server, client or both.
Below is a table of attributes that SHOULD be included on client and server RPC
measurements.

<!-- semconv rpc -->
| Attribute | Type | Description | Examples | Required |
Expand Down Expand Up @@ -112,4 +113,38 @@ For remote procedure calls via [gRPC][], additional conventions are described in

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

### gRPC Attributes

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

<!-- semconv rpc -->
| Attribute | Type | Description | Examples | Required |
|-----------------------------------------------------------------------------------|------|--------------------------------------------------------------------------------------------------------------|----------|----------|
| [`rpc.grpc.status_code`](../../trace/semantic_conventions/rpc.md#grpc-attributes) | int | The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. | `0` | Yes |
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved

`rpc.grpc.status_code` MUST be one of the following:

| Value | Description |
|------|---------------------|
| `0` | OK |
| `1` | CANCELLED |
| `2` | UNKNOWN |
| `3` | INVALID_ARGUMENT |
| `4` | DEADLINE_EXCEEDED |
| `5` | NOT_FOUND |
| `6` | ALREADY_EXISTS |
| `7` | PERMISSION_DENIED |
| `8` | RESOURCE_EXHAUSTED |
| `9` | FAILED_PRECONDITION |
| `10` | ABORTED |
| `11` | OUT_OF_RANGE |
| `12` | UNIMPLEMENTED |
| `13` | INTERNAL |
| `14` | UNAVAILABLE |
| `15` | DATA_LOSS |
| `16` | UNAUTHENTICATED |
<!-- endsemconv -->

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

jack-berg marked this conversation as resolved.
Show resolved Hide resolved
[gRPC]: https://grpc.io/