-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(envelopes): Add envelope item constraints summary #16666
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
Open
philipphofmann
wants to merge
2
commits into
master
Choose a base branch
from
philipp/envelope-item-constraints
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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 |
|---|---|---|
|
|
@@ -3,6 +3,12 @@ title: Envelope Items | |
| sidebar_order: 80 | ||
| --- | ||
|
|
||
| <Alert> | ||
| This document uses key words such as "MUST", "SHOULD", and "MAY" as defined | ||
| in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt) to indicate requirement | ||
| levels. | ||
| </Alert> | ||
|
|
||
| Each Envelope consists of headers and a potentially empty list of Items, each | ||
| with their own headers. Which Headers are required depends on the Items in an | ||
| Envelope. This section describes all Item types and their respective required | ||
|
|
@@ -14,6 +20,27 @@ The type of an Item is declared in the `type` header, as well as the payload | |
| size in `length`. See Serialization Format for a list of common Item headers. | ||
| The headers described in this section are **in addition to the common headers**. | ||
|
|
||
| ## Envelope Item Constraints | ||
|
|
||
| SDKs **SHOULD NOT** combine different types of telemetry data in the same envelope, because Relay enforces [rate limits](/sdk/foundations/transport/rate-limiting/) per [data category](/sdk/foundations/transport/rate-limiting/#definitions), and mixing types makes this enforcement more expensive. Exceptions to this rule are listed below (e.g., sessions, client reports, and attachments **MAY** be combined with other items). | ||
|
|
||
| The following constraints apply: | ||
|
|
||
| 1. **Mutual exclusivity**: | ||
| - [`event`](#event) and [`transaction`](#transaction) envelope items are mutually exclusive. | ||
| - [`feedback`](/sdk/telemetry/feedbacks/#envelope-item-constraints) and [`transaction`](#transaction) envelope items are mutually exclusive. | ||
| 2. **Spans**: An envelope **MUST** contain at most one envelope item containing spans, and all spans **MUST** share a single traceID; see [Span Buffer](/sdk/telemetry/spans/span-buffer/). | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cleptric I'm not 100% sure if that's actually the case that you can only send one envelope item containing spans per envelope. If not, I will adjust the docs here accordingly. |
||
| 3. **Logs**: An envelope **MUST** contain at most one envelope item containing logs. Logs from different traces **MAY** be mixed in the same envelope item, but if they are, the envelope **MUST NOT** include a [DSC](/sdk/foundations/trace-propagation/dynamic-sampling-context/) header; see [Logs](/sdk/telemetry/logs/#log-envelope-item). | ||
| 4. **Metrics**: An envelope **MUST** contain at most one envelope item containing metrics. Metrics from different traces **MAY** be mixed in the same envelope item, but if they are, the envelope **MUST NOT** include a [DSC](/sdk/foundations/trace-propagation/dynamic-sampling-context/) header; see [Metrics](/sdk/telemetry/metrics/#trace_metric-envelope-item). | ||
| 5. **Sessions**: Multiple envelope items containing sessions **MAY** appear in a single envelope; see [Sessions](/sdk/telemetry/sessions/#session-update-payload). | ||
| 6. **Attachments**: Multiple envelope items containing attachments **MAY** appear in a single envelope. Minidump and Apple crash report attachment envelope items **MUST** be sent in the same envelope as their event; see [Attachments](/sdk/telemetry/attachments/#standard-attachments). | ||
| 7. **Check-ins**: An envelope **MUST** contain at most one envelope item containing a check-in; see [Check-Ins](/sdk/telemetry/check-ins/#envelope-constraints). | ||
| 8. **Client reports**: Multiple envelope items containing client reports **MAY** appear in a single envelope; see [Client Reports](/sdk/telemetry/client-reports/#wire-format). | ||
| 9. **Replays**: The `replay_event` and `replay_recording` envelope items **MUST** always be sent together in the same envelope; see [Replay](/sdk/telemetry/replays/#replay-event-payload). | ||
| 10. **User reports (deprecated)**: `user_report` envelope items **SHOULD** be sent in the same envelope as their associated event; see [User Reports](/sdk/telemetry/user-reports/#envelope-item). | ||
|
|
||
| ## Envelope Item Types | ||
|
|
||
| ### Event | ||
|
|
||
| Item type `"event"`. This Item contains an error or default [event payload](/sdk/foundations/transport/event-payloads/) | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cleptric, I added a comment for this on the initial GitHub issue #16188 (comment), but I'm not 100% sure if this is actually the case.
And maybe we should even change this to: SDKs MUST NOT combine different types of telemetry data in the same envelope. Please let me know.