Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions .chloggen/3921.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
change_type: breaking
component: rpc
note: Rename `rpc.response.status_code` to `rpc.status_code`.
issues: [3870]
8 changes: 4 additions & 4 deletions docs/non-normative/compatibility/grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ and the [OpenTelemetry conventions](/docs/rpc/rpc-metrics.md) for details.
| gRPC attribute | OpenTelemetry attribute(s) | Conversion comments |
| :----------------- | :--------------------------------- | :------------------- |
| `grpc.method` | `rpc.method` | gRPC -> OTel: When the value is `other`, replace it with `_OTHER`<br>OTel -> gRPC: When the value is `_OTHER`, replace it with `other` |
| `grpc.status` | `rpc.response.status_code` | |
| `grpc.status` | `rpc.status_code` | |
| `grpc.target` | | gRPC -> OTel: Drop<br>OTel -> gRPC: Set `grpc.target` to `{server.address}[:{server.port}]` |
| | `server.address` and `server.port` | gRPC -> OTel: Parse the address and port from `grpc.target`<br>OTel -> gRPC: Drop |
| | `rpc.system.name` | gRPC -> OTel: Set to `grpc`<br>OTel -> gRPC: Drop |
| | `error.type` | gRPC -> OTel: Set to `rpc.response.status_code` when it indicates an error (see [gRPC OpenTelemetry conventions](/docs/rpc/grpc.md))<br>OTel -> gRPC: Drop |
| | `error.type` | gRPC -> OTel: Set to `rpc.status_code` when it indicates an error (see [gRPC OpenTelemetry conventions](/docs/rpc/grpc.md))<br>OTel -> gRPC: Drop |

## Spans

Expand All @@ -75,11 +75,11 @@ per-call server span.
| Property | gRPC | OpenTelemetry | Conversion comments |
| :---------------------- | :--------------------------------------------------------------- | :--------------------------------------------------------------------------- | :-------------------------------------------------------- |
| Span name | `Sent.{method name}` (client)<br>`Recv.{method name}` (server)<br>Note: The gRPC span name *may be* of high cardinality in edge cases. | `{rpc.method}` | gRPC -> OTel: Remove the `Sent.` or `Recv.` prefix<br>OTel -> gRPC: Add the prefix based on the span kind |
| Span status code | `ERROR` when the response status code is not `OK` | `ERROR` for specific error status codes (see the [gRPC OpenTelemetry conventions](/docs/rpc/grpc.md)) | gRPC -> OTel: Parse `rpc.response.status_code` from the status description and set the span status code accordingly<br>OTel -> gRPC: Set based on `rpc.response.status_code`<br> |
| Span status code | `ERROR` when the response status code is not `OK` | `ERROR` for specific error status codes (see the [gRPC OpenTelemetry conventions](/docs/rpc/grpc.md)) | gRPC -> OTel: Parse `rpc.status_code` from the status description and set the span status code accordingly<br>OTel -> gRPC: Set based on `rpc.status_code`<br> |
| Span status description | Code and description (e.g., `UNAVAILABLE, unable to resolve host`)| Description only (the error code is recorded separately) | |
| Attributes | | `rpc.system.name` | gRPC -> OTel: set to `grpc`<br>OTel -> gRPC: drop |
| | | `rpc.method` | gRPC -> OTel: parse from the span name<br>OTel -> gRPC: drop |
| | | `rpc.response.status_code` | gRPC -> OTel: parse from the status description<br>OTel -> gRPC: drop |
| | | `rpc.status_code` | gRPC -> OTel: parse from the status description<br>OTel -> gRPC: drop |

### Additional attributes

Expand Down
8 changes: 4 additions & 4 deletions docs/non-normative/rpc-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ TODO (latest).
| `rpc.service` | [#3223](https://github.com/open-telemetry/semantic-conventions/pull/3223) | Removed, integrated into `rpc.method` |
| `network.transport` | [#3350](https://github.com/open-telemetry/semantic-conventions/pull/3350) | Removed |
| `network.type` | [#2857](https://github.com/open-telemetry/semantic-conventions/pull/2857) | Removed |
| `rpc.grpc.status_code` &rarr; `rpc.response.status_code` | [#2920](https://github.com/open-telemetry/semantic-conventions/pull/2920) | Changed from int to string (e.g., `0` &rarr; `"OK"`) |
| `rpc.connect_rpc.error_code` &rarr; `rpc.response.status_code` | [#2920](https://github.com/open-telemetry/semantic-conventions/pull/2920) | |
| `rpc.grpc.status_code` &rarr; `rpc.status_code` | [#2920](https://github.com/open-telemetry/semantic-conventions/pull/2920), [#3921](https://github.com/open-telemetry/semantic-conventions/pull/3921) | Changed from int to string (e.g., `0` &rarr; `"OK"`) |
| `rpc.connect_rpc.error_code` &rarr; `rpc.status_code` | [#2920](https://github.com/open-telemetry/semantic-conventions/pull/2920), [#3921](https://github.com/open-telemetry/semantic-conventions/pull/3921) | |
| `rpc.grpc.request.metadata.<key>` | [#3169](https://github.com/open-telemetry/semantic-conventions/pull/3169) | Replaced by `rpc.request.metadata.<key>` |
| `rpc.grpc.response.metadata.<key>` | [#3169](https://github.com/open-telemetry/semantic-conventions/pull/3169) | Replaced by `rpc.response.metadata.<key>` |
| `rpc.connect_rpc.request.metadata.<key>` | [#3169](https://github.com/open-telemetry/semantic-conventions/pull/3169) | Replaced by `rpc.request.metadata.<key>` |
Expand Down Expand Up @@ -117,7 +117,7 @@ Metric changes:
| `network.type` | [#2857](https://github.com/open-telemetry/semantic-conventions/pull/2857) | Removed |
| `server.address` | [#3197](https://github.com/open-telemetry/semantic-conventions/pull/3197) | Changed from Recommended to Opt-In |
| `server.port` | [#3197](https://github.com/open-telemetry/semantic-conventions/pull/3197) | Changed from Recommended to Opt-In |
| New: `rpc.response.status_code` | [#2920](https://github.com/open-telemetry/semantic-conventions/pull/2920) | |
| New: `rpc.status_code` | [#2920](https://github.com/open-telemetry/semantic-conventions/pull/2920), [#3921](https://github.com/open-telemetry/semantic-conventions/pull/3921) | |
| New: `error.type` | [#2852](https://github.com/open-telemetry/semantic-conventions/pull/2852) | |
<!-- prettier-ignore-end -->

Expand Down Expand Up @@ -149,7 +149,7 @@ Metric changes:
| `network.type` | [#2857](https://github.com/open-telemetry/semantic-conventions/pull/2857) | Removed |
| `server.address` | [#3197](https://github.com/open-telemetry/semantic-conventions/pull/3197) | Changed from Recommended to Required |
| `server.port` | [#3197](https://github.com/open-telemetry/semantic-conventions/pull/3197) | Changed from Recommended to Conditionally Required |
| New: `rpc.response.status_code` | [#2920](https://github.com/open-telemetry/semantic-conventions/pull/2920) | |
| New: `rpc.status_code` | [#2920](https://github.com/open-telemetry/semantic-conventions/pull/2920), [#3921](https://github.com/open-telemetry/semantic-conventions/pull/3921) | |
| New: `error.type` | [#2852](https://github.com/open-telemetry/semantic-conventions/pull/2852) | |
<!-- prettier-ignore-end -->

Expand Down
6 changes: 3 additions & 3 deletions docs/otel/sdk-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ covering the wall-clock duration from the start of the first attempt through the
| [`http.response.status_code`](/docs/registry/attributes/http.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` when applicable | int | The HTTP status code of the last HTTP request performed in scope of this export call. | `200` |
| [`otel.component.name`](/docs/registry/attributes/otel.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance. [2] | `otlp_grpc_span_exporter/0`; `custom-name` |
| [`otel.component.type`](/docs/registry/attributes/otel.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | A name identifying the type of the OpenTelemetry component. [3] | `otlp_grpc_span_exporter`; `com.example.MySpanExporter` |
| [`rpc.response.status_code`](/docs/registry/attributes/rpc.md) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Recommended` when applicable | string | The gRPC status code of the last gRPC request performed in scope of this export call. [4] | `OK`; `DEADLINE_EXCEEDED`; `-32602` |
| [`rpc.status_code`](/docs/registry/attributes/rpc.md) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Recommended` when applicable | string | The gRPC status code of the last gRPC request performed in scope of this export call. [4] | `OK`; `DEADLINE_EXCEEDED`; `-32602` |
| [`server.address`](/docs/registry/attributes/server.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` when applicable | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or UNIX domain socket name. [5] | `example.com`; `10.1.2.80`; `/tmp/my.sock` |
| [`server.port`](/docs/registry/attributes/server.md) | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | `Recommended` when applicable | int | Server port number. [6] | `80`; `8080`; `443` |

Expand Down Expand Up @@ -1349,8 +1349,8 @@ These values will therefore be reused in the case of an application restart.
**[3] `otel.component.type`:** If none of the standardized values apply, implementations SHOULD use the language-defined name of the type.
E.g. for Java the fully qualified classname SHOULD be used in this case.

**[4] `rpc.response.status_code`:** Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.
Semantic conventions for individual RPC frameworks SHOULD document what `rpc.response.status_code` means in the context of that system and which values are considered to represent errors.
**[4] `rpc.status_code`:** Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.
Semantic conventions for individual RPC frameworks SHOULD document what `rpc.status_code` means in the context of that system and which values are considered to represent errors.

**[5] `server.address`:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.

Expand Down
Loading
Loading