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(spans): Add TTID and TTFD tags #2662

Merged
merged 4 commits into from
Oct 30, 2023
Merged

feat(spans): Add TTID and TTFD tags #2662

merged 4 commits into from
Oct 30, 2023

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented Oct 27, 2023

If ui.load.initial_display and/or ui.load.full_display spans are present, mark spans happening before those with ttid and ttfd tags.

@jjbayer jjbayer changed the title Feat/spans ttfd tag feat(spans): Add TTID and TTFD tags Oct 27, 2023
Comment on lines 894 to 895
assert_eq!(tags.get("ttid").unwrap().as_str(), Some("true"));
assert_eq!(tags.get("ttfd").unwrap().as_str(), Some("true"));
Copy link
Member Author

Choose a reason for hiding this comment

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

@shruthilayaj spans that contribute to initial display also contribute to full display. Does that make sense?

Copy link
Member

Choose a reason for hiding this comment

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

yes, TTID contributing spans are a subset of TTFD contributing spans!

@jjbayer jjbayer marked this pull request as ready for review October 27, 2023 11:06
@jjbayer jjbayer requested review from a team and shruthilayaj October 27, 2023 11:06
Copy link
Contributor

@olksdr olksdr left a comment

Choose a reason for hiding this comment

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

Left one small comment, otherwise LGTM.

span_tags
}

/// Finds time-to-initial/full-display spans and returns its end times.
fn display_times(spans: &[Annotated<Span>]) -> (Option<Timestamp>, Option<Timestamp>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe instead of the tuple here it would be clearer to create a struct and set the fields with proper names in it.
It can be easy to mistaken the order of the returned values just looking at the function signature.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I refactored this to use .find() instead of writing a homemade loop now, let me know what you think.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, nice!

Copy link
Member

@shruthilayaj shruthilayaj left a comment

Choose a reason for hiding this comment

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

🚢

jjbayer added a commit to getsentry/sentry that referenced this pull request Oct 30, 2023
@jjbayer jjbayer merged commit 219676e into master Oct 30, 2023
@jjbayer jjbayer deleted the feat/spans-ttfd-tag branch October 30, 2023 08:49
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.

3 participants