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

feat(server): Serialize the DSC into event payloads #3811

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- Copy root span data from `contexts.trace.data` when converting transaction events into raw spans. ([#3790](https://github.com/getsentry/relay/pull/3790))
- Remove experimental double-write from spans to transactions. ([#3801](https://github.com/getsentry/relay/pull/3801))
- Add feature flag to disable replay-video events. ([#3803](https://github.com/getsentry/relay/pull/3803))
- Write the envelope's Dynamic Sampling Context (DSC) into event payloads for debugging. ([#3811](https://github.com/getsentry/relay/pull/3811))

## 24.6.0

Expand Down
4 changes: 4 additions & 0 deletions relay-event-schema/src/protocol/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,10 @@ pub struct Event {
#[metastructure(omit_from_schema)]
pub _metrics_summary: Annotated<MetricsSummary>,

/// Value of the `DynamicSamplingContext` for this event.
#[metastructure(omit_from_schema)]
pub _dsc: Annotated<Value>,

/// Additional arbitrary fields for forwards compatibility.
#[metastructure(additional_properties, pii = "true")]
pub other: Object<Value>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,6 @@ Event {
scraping_attempts: ~,
_metrics: ~,
_metrics_summary: ~,
_dsc: ~,
other: {},
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,6 @@ Event {
scraping_attempts: ~,
_metrics: ~,
_metrics_summary: ~,
_dsc: ~,
other: {},
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,6 @@ Event {
scraping_attempts: ~,
_metrics: ~,
_metrics_summary: ~,
_dsc: ~,
other: {},
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,6 @@ Event {
scraping_attempts: ~,
_metrics: ~,
_metrics_summary: ~,
_dsc: ~,
other: {},
}
6 changes: 6 additions & 0 deletions relay-server/src/services/processor/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ pub fn finalize<G: EventProcessing>(
);
}
}

if let Some(dsc) = envelope.dsc() {
if let Ok(Some(value)) = relay_protocol::to_value(dsc) {
event._dsc = Annotated::new(value);
}
}
}

let mut processor =
Expand Down
Loading