Skip to content

rfc(feature): Support Linking Traces #141

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

Merged
merged 21 commits into from
Jan 10, 2025
Merged

rfc(feature): Support Linking Traces #141

merged 21 commits into from
Jan 10, 2025

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Nov 8, 2024

This RFC specifies our plans to support linked traces via span links.

Since this became quite a lot of text, I recommend especially reading the Preferred Option section which specifies SDK, Relay and Storage changes. The other sections are supposed to provide context and additional information.

Rendered Document

ref: https://github.com/getsentry/projects/issues/268

@Lms24 Lms24 self-assigned this Nov 8, 2024
@andreiborza
Copy link
Member

Great stuff! One thing I was wondering about is how links are affected by span filtering. What if links are actively dropped by users? Is that a concern?

@Lms24
Copy link
Member Author

Lms24 commented Nov 18, 2024

Great stuff! One thing I was wondering about is how links are affected by span filtering. What if links are actively dropped by users? Is that a concern?

I would argue that this is up to users. If users decide to drop a span link, we just won't be able to link the respective spans together. Meaning, unless there's a strong case for consistent sampling across traces (which is still TBD) I think we can permit mutation of links just like any other span property.

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Thanks for all the deep context and background. I added a few comments.

@mjq
Copy link
Member

mjq commented Nov 26, 2024

Sorry, looks like "starting a review" with both new comments and replies got weird and duplicated a bunch of stuff in the timeline above. Sorry 😬

@Lms24 Lms24 marked this pull request as ready for review December 3, 2024 11:37
@Lms24 Lms24 marked this pull request as draft December 3, 2024 11:37
@Lms24 Lms24 requested a review from krystofwoldrich December 3, 2024 11:37
@cleptric cleptric self-requested a review December 4, 2024 19:43
@Lms24 Lms24 force-pushed the lms/linking-traces branch from 47f34d9 to 9012b51 Compare December 19, 2024 15:21
@Lms24 Lms24 changed the title [WIP] rfc(feature): Support Linking Traces rfc(feature): Support Linking Traces Dec 19, 2024
@Lms24 Lms24 marked this pull request as ready for review December 19, 2024 15:29
Copy link
Member

@cleptric cleptric left a comment

Choose a reason for hiding this comment

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

Let's do it.

Copy link
Member

@smeubank smeubank left a comment

Choose a reason for hiding this comment

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

I would go with your preferred option. Great write up, thorough and detail. Glad the session topic was address as well.

One option that is not here, is the "do nothing". i suppose, but maybe that is pedantic.

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LTGM :shipit:

While this doesn't solve all of our long-lived trace problems, and I would love to see traces linked to sessions, this is a significant step in the right direction. This concept will solve multiple issues you thoroughly described in the RFC. It's also excellent that OTel already has this concept

Thanks for the detailed write-up. I'm looking forward to implementing this.

Comment on lines +367 to +369
It's worth noting that we will not link to the previous positively sampled trace if a negatively sampled trace is in-between (see Traces 2-4 in the diagram). Furthermore, we will not show _how many_ traces were negatively sampled in between two trace chains; only that there was at least one trace in between (see Trace 5-8).

There are some ideas how we could show multiple negatively sampled spans as well as how we could connect traces with gaps due to sampling. For now, we'll disregard this because there's no concrete use case, yet. However, given spans can have multiple links and links can have attributes, we could add this information later on, if we deem it necessary.
Copy link
Member

Choose a reason for hiding this comment

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

Most customers don't sample at 100%. They will frequently experience previously negatively sampled traces. I can imagine that some customers would like to navigate to the last positively sampled trace when most of their previous traces are negatively sampled. But it might be OK to wait for customers to ask for that feature. The current proposal would allow multiple options to achieve this without changing the APIs and the protocol.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup. I sketched out a solution a while ago how we could add multiple links to indicate missing traces due to sampling:
image

I didn't include this in the RFC because as I wrote, it's something we can tackle if there's demand for it.

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.

10 participants