-
Notifications
You must be signed in to change notification settings - Fork 345
Separate RPC events from spans #3226
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| <!--- Hugo front matter used to generate the website version of this page: | ||
| linkTitle: Events | ||
| ---> | ||
|
|
||
| # Semantic conventions for RPC events | ||
|
|
||
| **Status**: [Development][DocumentStatus] | ||
|
|
||
| This document defines events applicable in the context of remote procedure calls. | ||
|
|
||
| > [!IMPORTANT] | ||
| > Existing RPC instrumentations that are using | ||
| > [v1.37.0 of this document](https://github.com/open-telemetry/semantic-conventions/blob/v1.37.0/docs/rpc/rpc-spans.md#events) | ||
| > (or prior): | ||
| > | ||
| > * SHOULD NOT change the version of the RPC conventions that they emit by | ||
| > default in their existing major version. Conventions include (but are not | ||
| > limited to) attributes, metric and span names, and unit of measure. | ||
| > * SHOULD introduce an environment variable `OTEL_SEMCONV_STABILITY_OPT_IN` | ||
| > in their existing major version as a comma-separated list of category-specific values | ||
| > (e.g., http, databases, rpc). The list of values includes: | ||
| > * `rpc` - emit the stable RPC conventions, and stop emitting | ||
| > the experimental RPC conventions that the instrumentation emitted | ||
| > previously. | ||
| > * `rpc/dup` - emit both the experimental and stable RPC conventions, | ||
| > allowing for a phased rollout of the stable semantic conventions. | ||
| > * The default behavior (in the absence of one of these values) is to continue | ||
| > emitting whatever version of the old experimental RPC conventions | ||
| > the instrumentation was emitting previously. | ||
| > * Note: `rpc/dup` has higher precedence than `rpc` in case both values are present | ||
| > * SHOULD maintain (security patching at a minimum) their existing major version | ||
| > for at least six months after it starts emitting both sets of conventions. | ||
| > * MAY drop the environment variable in their next major version and emit only | ||
| > the stable RPC conventions. | ||
|
|
||
| ## Message event | ||
|
lmolkova marked this conversation as resolved.
|
||
|
|
||
| <!-- semconv event.rpc.message --> | ||
| <!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. --> | ||
| <!-- see templates/registry/markdown/snippet.md.j2 --> | ||
| <!-- prettier-ignore-start --> | ||
|
|
||
| **Status:**  | ||
|
|
||
| The event name MUST be `rpc.message`. | ||
|
|
||
| Describes a message sent or received within the context of an RPC call. | ||
|
|
||
| In the lifetime of an RPC stream, an event for each message sent/received on client and server spans SHOULD be created. In case of unary calls message events SHOULD NOT be recorded. | ||
|
|
||
| **Attributes:** | ||
|
|
||
| | Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | | ||
| | --- | --- | --- | --- | --- | --- | | ||
| | [`rpc.message.compressed_size`](/docs/registry/attributes/rpc.md) |  | `Recommended` | int | Compressed size of the message in bytes. | | | ||
| | [`rpc.message.id`](/docs/registry/attributes/rpc.md) |  | `Recommended` | int | MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. [1] | | | ||
| | [`rpc.message.type`](/docs/registry/attributes/rpc.md) |  | `Recommended` | string | Whether this is a received or sent message. | `SENT`; `RECEIVED` | | ||
| | [`rpc.message.uncompressed_size`](/docs/registry/attributes/rpc.md) |  | `Recommended` | int | Uncompressed size of the message in bytes. | | | ||
|
|
||
| **[1] `rpc.message.id`:** This way we guarantee that the values will be consistent between different implementations. | ||
|
|
||
| --- | ||
|
|
||
| `rpc.message.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | ||
|
|
||
| | Value | Description | Stability | | ||
| | --- | --- | --- | | ||
| | `RECEIVED` | received |  | | ||
| | `SENT` | sent |  | | ||
|
|
||
| <!-- prettier-ignore-end --> | ||
| <!-- END AUTOGENERATED TEXT --> | ||
| <!-- endsemconv --> | ||
|
|
||
| [DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| groups: | ||
| - id: event.rpc.message | ||
| type: event | ||
| stability: development | ||
| name: rpc.message | ||
| brief: Describes a message sent or received within the context of an RPC call. | ||
| note: > | ||
| In the lifetime of an RPC stream, an event for each message sent/received on | ||
| client and server spans SHOULD be created. In case of unary calls message | ||
| events SHOULD NOT be recorded. | ||
| attributes: | ||
| - ref: rpc.message.type | ||
| requirement_level: recommended | ||
| - ref: rpc.message.id | ||
| requirement_level: recommended | ||
| - ref: rpc.message.compressed_size | ||
| requirement_level: recommended | ||
| - ref: rpc.message.uncompressed_size | ||
| requirement_level: recommended |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.