feat(client-reports): Protocol support for client reports #1081
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.
Second attempt of #1074.
This adds support for client reports from the SDKs. This feature is primarily
used to allow client SDKs to emit outcomes.
The way this is currently implemented is that we add a new envelope item
type called
client_report
which contains these outcomes. The envelope itemtype is intentionally kept flexible for future expansion as we already discussed
emitting other internal debug information upstream which is unrelated to
outcomes (eg: number of breadcrumbs discarded and configuration errors).
Because of how SDKs are currently implemented we now reserve internal
as data category for such metric items. Relay however will never emit
such a data category as we do not want to communicate actual rate limits
for such envelope items.
From the relay perspective any outcome reason that an SDK emits is
acceptable and upstreamed. It's up to the snuba consumer to whitelist
these outcomes to avoid writing bad data into the kafka topic. This
way SDKs can send more outcomes even if relays have not been updated.
The emitting of client outcomes can be disabled with the
emit_client_outcomes
flag which is also honored on processing relay stop the flow of data to the
kafka topic.