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(profiling): Add support for Rust profiles ingestion #1296

Merged
merged 7 commits into from
Jun 10, 2022

Conversation

viglia
Copy link
Contributor

@viglia viglia commented Jun 8, 2022

This PR aims at supporting the ingestion of Rust profiles.

This was tested e2e by sending and ingesting a sample rust profile.

Link to related sentry PR

@viglia viglia self-assigned this Jun 8, 2022
@viglia viglia requested a review from a team June 8, 2022 13:41
@viglia viglia marked this pull request as ready for review June 8, 2022 14:14
@viglia viglia requested a review from a team June 8, 2022 14:14
relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
@viglia viglia requested a review from jjbayer June 9, 2022 12:46
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just a few minor comments.

relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

Approving this ahead of time, please see the comments below for minor changes on field names and types used.

relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
pub struct RustSample {
pub frames: Vec<RustFrame>,
pub thread_name: String,
pub thread_id: u64,
Copy link
Member

Choose a reason for hiding this comment

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

The thread_id can be alphanumeric on some platforms, at least we also support strings in the event protocol. Are you certain you can constrain this to u64? See ThreadId. You could import and use this enum directly here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jan-auer yes, because client-side I'm using pprof-rs for which thread_id is only defined as u64.

see here

relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
relay-server/src/utils/profile.rs Outdated Show resolved Hide resolved
Rust as_nanos returns u128. Unfortunately we can't store u128 into the DB, nor can Golang handle u128.
As a fix here some fields are refactored to hold u64 values.
That's enough to store the timing info we need without causing an overflow.
@viglia viglia force-pushed the viglia/profiling-add-rust-support branch from 8db77e2 to 977502c Compare June 9, 2022 16:20
@viglia viglia requested a review from phacops June 9, 2022 17:03
@viglia viglia merged commit eb3c427 into master Jun 10, 2022
@viglia viglia deleted the viglia/profiling-add-rust-support branch June 10, 2022 13:04
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.

None yet

4 participants