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(relay): Add span links to event schema #4486

Merged
merged 7 commits into from
Feb 6, 2025
Merged

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Feb 5, 2025

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 in

  • event.contexts.trace.links for links of the root span/transaction
  • event.spans[i].links for links of child spans

This 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 Answered questions:

  • This PR does not include any kind of validation logic for passed attributes or links in general. Specifically, the question was if we should validate against known span attributes. For now, we decided not to do this to avoid dropping an event. We can revisit if necessary.

EDIT: Updated description with answered questions

closes #4443

@Lms24 Lms24 marked this pull request as ready for review February 5, 2025 14:51
@Lms24 Lms24 requested a review from a team as a code owner February 5, 2025 14:51
@Lms24 Lms24 requested a review from jjbayer February 5, 2025 14:52
CHANGELOG.md Outdated Show resolved Hide resolved
relay-event-schema/src/protocol/span.rs Show resolved Hide resolved
relay-event-schema/src/protocol/span.rs Show resolved Hide resolved
assert mini_sentry.captured_events.empty()


def test_event_with_span_links_in_child_span(relay, mini_sentry):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: You could probably merge these tests into one by having a transaction with both trace context links and child span links.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing: 47b32d8

@Lms24 Lms24 merged commit d6f592e into master Feb 6, 2025
25 checks passed
@Lms24 Lms24 deleted the lms/feat-span-links branch February 6, 2025 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Span Links
2 participants