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(suspect-spans): Add exclusive time for root span #1083

Merged
merged 7 commits into from
Sep 22, 2021

Conversation

Zylphrex
Copy link
Member

Following up with #1061, this change adds the exclusive time calculation for the
root span of a transaction.

Following up with #1061, this change adds the exclusive time calculation for the
root span of a transaction.
@Zylphrex Zylphrex requested review from a team September 10, 2021 15:47
/// The amount of time in milliseconds spent in this transaction span, excluding its immediate
/// child spans. (relevant for event type = "transaction")
#[metastructure(omit_from_schema)] // we only document error events for now
pub exclusive_time: Annotated<f64>,
Copy link
Member

Choose a reason for hiding this comment

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

Please add this in the trace context instead

Copy link
Member

@untitaker untitaker left a comment

Choose a reason for hiding this comment

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

wups, see comments

@Zylphrex Zylphrex requested a review from untitaker September 16, 2021 23:09
Copy link
Member

@untitaker untitaker left a comment

Choose a reason for hiding this comment

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

@Zylphrex I believe this attribute would be better in trace context.

@Zylphrex
Copy link
Member Author

@Zylphrex I believe this attribute would be better in trace context.

Ahh my bad, I did not push the changes in the preview commit. Should be updated now.

@Zylphrex Zylphrex requested a review from untitaker September 17, 2021 14:36
CHANGELOG.md Outdated
@@ -24,7 +24,7 @@
**Internal**:

- Add new metrics on Relay's performance in dealing with buckets of metric aggregates, as well as the amount of aggregated buckets. ([#1070](https://github.com/getsentry/relay/pull/1070))
- Add the exclusive time of a span. ([#1061](https://github.com/getsentry/relay/pull/1061))
- Add the exclusive time of a span. ([#1061](https://github.com/getsentry/relay/pull/1061)), ([#1083](https://github.com/getsentry/relay/pull/1083))
Copy link
Member

Choose a reason for hiding this comment

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

@Zylphrex the changelog for 1083 should be moved to the top at the Unreleased section. This line is associated with v21.9.0.

}

set_event_exclusive_time(event, &mut span_map);

let spans = event.spans.value_mut().get_or_insert_with(|| Vec::new());
Copy link
Member

Choose a reason for hiding this comment

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

I notice this inserts a new vector if event.spans doesn't have one set. @untitaker would this be fine?

Copy link
Member

Choose a reason for hiding this comment

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

apparently we already did that before so I am not too worried about that

you can avoid the double-borrowing here if you change set_event_exclusive_time to take timestamps and a mutable reference to contexts instead of the entire event. then you can still hold a mutable reference to spans throughout this entire function

}

set_event_exclusive_time(event, &mut span_map);

let spans = event.spans.value_mut().get_or_insert_with(|| Vec::new());
Copy link
Member

Choose a reason for hiding this comment

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

apparently we already did that before so I am not too worried about that

you can avoid the double-borrowing here if you change set_event_exclusive_time to take timestamps and a mutable reference to contexts instead of the entire event. then you can still hold a mutable reference to spans throughout this entire function

Copy link
Member

@dashed dashed left a comment

Choose a reason for hiding this comment

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

lfg.

@Zylphrex Zylphrex merged commit a1303ce into master Sep 22, 2021
@Zylphrex Zylphrex deleted the feat/add-exclusive-time-for-root-span branch September 22, 2021 14:10
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