feat: Profiling#2206
Merged
mattjohnsonpint merged 70 commits intomainfrom Apr 14, 2023
Merged
Conversation
Contributor
|
47b99ff to
62aafa9
Compare
514c623 to
a7911d2
Compare
Member
|
Outcome of a chat between @vaind and I:
|
mattjohnsonpint
suggested changes
Apr 9, 2023
mattjohnsonpint
suggested changes
Apr 10, 2023
Contributor
|
Looks like something in the latest changes broke things. Everything else looks good, so after resolving that all that's needed is the license file and and then I will approve. Thanks!!! |
Co-authored-by: Matt Johnson-Pint <matt.johnson-pint@sentry.io>
Contributor
|
Oh, and a changelog entry also. Let's go with "Initial work to support profiling in a future release." - since we're not making it available just yet. And we should also add a |
mattjohnsonpint
approved these changes
Apr 14, 2023
Contributor
|
Merged. Thanks!!! |
This was referenced Apr 17, 2023
Contributor
JFYI MonoVM does have the identical sampling profiler mechanism. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1955
This uses Diagnostic IPC to connect to the CLR in-process, capture
Microsoft-DotNETCore-SampleProfilertrace events and transforms them to the format Sentry understands.In its current state, the feature is in a good shape for alfa testing but there's a major followup to resolve and that is how
TraceLog, which is a tool to process raw events and get figure out stack traces, works, i.e. that it requires files and needs to be saved & then loaded from file to be actually usable (see here). I'm starting to lean towards a fork/copy of relevant parts where we gut it to get what we need and drop the rest. That way we could also do without the rundown provider that gives as all past .net runtime events when we start a profile. Functionally (from the user perspective), the profile should look the same, but the implementation should be more efficient than it is now, especially the processing that happens after the profiling stops and also it would be most noticeable for short transactions if we could avoid requesting all past CLR runtime events (for simple app, it's about 3 MB of data).TODOs
Followups
maybe filter-out threads that don't run any user code?marked as in-app=falseshould we filter-out sentry-specific/profiling-specific samples?marked as in-app=falsedebug_metaimages if we want to show line numbers - this may need to be opt-in as it will likely add some runtime overhead_session.EventStreambefore even transforming to ETLX.Microsoft-Windows-DotNETRuntimerundown provider (loaded libs, etc) in a separate session and merge with actual samples later during processing, if possible (merging nettrace files, or having a custom provider for TraceLog).