-
Notifications
You must be signed in to change notification settings - Fork 94
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(relay): Add span links to event schema #4486
base: master
Are you sure you want to change the base?
Conversation
/// Span link attributes, similar to span attributes/data | ||
#[metastructure(pii = "maybe", trim = false)] | ||
pub attributes: Annotated<Object<Value>>, |
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.
Is this the correct way to let Relay know that this field can contain PII and should be scrubbed?
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.
To apply default scrubbing rules (not just when the user explicitly configures it through advanced rules), set pii = "true"
.
@@ -10,6 +10,7 @@ | |||
- Add flags context to event schema. ([#4458](https://github.com/getsentry/relay/pull/4458)) | |||
- Add support for view hierarchy attachment scrubbing. ([#4452](https://github.com/getsentry/relay/pull/4452)) | |||
- Allow configuration of Relay's log format via an environment variable. ([#4484](https://github.com/getsentry/relay/pull/4484)) | |||
- Add span links to event schema ([#4486](https://github.com/getsentry/relay/pull/4486)) |
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.
- Add span links to event schema ([#4486](https://github.com/getsentry/relay/pull/4486)) | |
- Add span links to event schema. ([#4486](https://github.com/getsentry/relay/pull/4486)) |
@@ -138,6 +138,10 @@ pub struct TraceContext { | |||
#[metastructure(pii = "maybe", skip_serialization = "null")] | |||
pub data: Annotated<SpanData>, | |||
|
|||
/// Links to other spans from the trace's root span. | |||
#[metastructure(pii = "maybe", skip_serialization = "null")] |
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.
pii = "maybe"
means it will only be scrubbed with Advanced Data Scrubbing Rules. Are there any link attributes that we expect to contain PII?
/// Span link attributes, similar to span attributes/data | ||
#[metastructure(pii = "maybe", trim = false)] | ||
pub attributes: Annotated<Object<Value>>, |
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.
To apply default scrubbing rules (not just when the user explicitly configures it through advanced rules), set pii = "true"
.
|
||
/// Span link attributes, similar to span attributes/data | ||
#[metastructure(pii = "maybe", trim = false)] | ||
pub attributes: Annotated<Object<Value>>, |
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.
If you want to validate the sentry.link.type
attribute, you can define attributes
as a type SpanLinkAttributes
that contains
struct SpanLinkAttributes {
#[metastructure(field = "sentry.link.type", ...)]
pub link_type: Annotated<LinkType>, // `LinkType` being an enum
#[metastructure(additional_properties, retain = true, ...)]
pub other: Object<Value>,
}
This PR adds span link definitions as spec'd out in RFC #141 to the
relay-event-schema
crate. As described in the envelope item payload section, span links can be added by SDKs inevent.contexts.trace.links
for links of the root span/transactionevent.spans[i].links
for links of child spansThis PR also adds integration tests for events with span links.
@reviewers, this is my first PR to Relay, so please let me know if I'm missing something or you want to see something else tested. Happy to make changes!
Open Questions
This PR does not include any kind of validation logic for passed attributes or links in general. Frankly, I'm a bit unsure what our approach for validation is in Relay.
sentry.link.type
attribute. Is this something we can/should enforce in Relay or handle further down the line?Happy to make further changes for this but it probably makes sense to tackle them in a follow-up PR.
ref #4443