-
-
Notifications
You must be signed in to change notification settings - Fork 226
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 profiling to debug_files commands #1325
Conversation
It looks like you rebased something on top of latest |
d4ff999
to
a8667a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for the tracing code itself, I need to ping @Swatinem as I've never used it in Rust.
Cargo.toml
Outdated
openssl-probe = "0.1.5" | ||
signal-hook = "0.3.14" | ||
crossbeam-channel = "0.5.5" | ||
sentry = { git = "https://github.com/getsentry/sentry-rust", version = "0.27.0", default-features = false, features = ["anyhow", "curl", "profiling", "frame-pointer"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifying url should be unnecessary here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the url
it's going to pull the latest published crate
I think.
I'm not sure made it to a release yet, plus I'm about to merge a PR to align to a new standard format for profiles across all the SDKs so that is def. not in any release yet.
We can coordinate this with @Swatinem to make sure we make a release and at that point we can use a specific version instead of pulling from master
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getsentry/sentry-rust#504 is already approved, so lets merge it, release new sentry-rust
and replace it with regular cargo index as it was previously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to hold on for a bit for that.
I can merge that yet as the related Relay, Sentry and Snuba PRs have yet to be merged.
Once those are merged I'll be able to merge the sentry-rust
, than I can use that as you suggested.
Fixed linting issue. |
1b8e376
to
1f6a18a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this example gives us a nice improvement opportunity for the global sentry API (wrapping a closure in a transaction)
I’m also not sure if some of these commands panic instead of returning an error, @kamilogorek can enlighten us here. I don’t think we currently finish a transaction when a panic occurs, and I’m also not sure that would work correctly the way that transactions can be shared by multiple hubs, or if that would even be desirable from a product point of view.
scripts/build-in-docker.sh
Outdated
cargo +nightly run -Z build-std --target ${TARGET}; | ||
RUSTFLAGS=\"-C force-frame-pointers=yes\" cargo build --release --target=${TARGET} --locked" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the CI job you use override
which means cargo +nightly
is the same as nightly
, but I think here the second command is actually using stable Rust vs nightly.
Not quite sure how exactly build-std
is supposed to work, I would need to look that up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I ran my experiments (both on Intel Mac and Linux VM) that seemed to work fine.
I'd run the second command without first enabling the nightly toolchain but simply using the stable one.
…ss of the results. Also: remove explicit flush as by default the 2 seconds flush is already provided by the drop implementation.
@@ -70,6 +70,7 @@ trycmd = "0.13.4" | |||
default = [] | |||
managed = [] | |||
with_crash_reporting = [] | |||
profiling = ["sentry"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the SDK is still used for other things in sentry-cli. Only the profiling (and frame pointer) feature needs to be optional in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that sentry
get imported in line 43
in the "normal" dependency.
This is more for the optional one at line 90
specific to Unix.
I can't use the "package-name?/feature-name"
syntax to simplify this because as you said sentry
as a dependency is already used regardless of profiling and I would end up adding profiling even when I should not.
Not sure if there is a better way to handle this case but I'm open for suggestions.
Yes, it can panic, and we have a hook for that in place as well sentry-cli/src/utils/system.rs Lines 140 to 170 in 0c4c6de
|
I'd revert all the changes from Cleaner solution IMO (at least for now), would be to modify |
sentry::ClientOptions { | ||
release: sentry::release_name!(), | ||
user_agent: crate::constants::USER_AGENT.into(), | ||
traces_sample_rate: 0.05, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if its worth it to move traces_sample_rate
and profiles_sample_rate
to constants.rs
Unwrap execute functions from the closures and instrument the execute function in debug_files/mod.rs instead
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
@viglia looks like this PR has been open for some time. Are the changes still relevant, and if yes, is the PR ready for review? |
@szokeasaurusrex, I'm closing it since it's not relevant anymore. |
No description provided.