getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
38.98k stars 4.18k forks source link

Start reporting memory usage for python in traces/profiles #78451

Open sky-code opened 3 weeks ago

sky-code commented 3 weeks ago

Problem Statement

Sentry provides good overview of time consumption in Trace View, for some projects/situations it very useful to have the same overview for memory usage.

For example in our use case we are doing files parsing and processing, they are very unpredictable in size/structure and may vary significantly, it is hard for us to identify what files and which one processing operation uses most memory and exact numbers.

Sentry reports memory usage for some platforms but does not for python, at the same time other observability tools support memory usage tracing, for example datadog and scout-apm but it's inconvenient to use couple APM tools for different types of metrics.

See also https://github.com/getsentry/sentry/discussions/49178

Solution Brainstorm

Make it as optional feature, capture process rss memory, show in profiler/trace view and add option in UI to switch between time and memory view. Something like that Image

Similar to SQL+1 detection, potential memory leaks / huge spikes can be detected and reported.

See also https://scoutapm.com/docs/features#memory-bloat-detection for inspiration.

Product Area

Profiling

getsantry[bot] commented 3 weeks ago

Assigning to @getsentry/support for routing ⏲️

getsantry[bot] commented 3 weeks ago

Routing to @getsentry/product-owners-performance for triage ⏲️

getsantry[bot] commented 2 weeks ago

Routing to @getsentry/product-owners-profiling for triage ⏲️

getsantry[bot] commented 2 weeks ago

Routing to @getsentry/product-owners-performance for triage ⏲️

bcoe commented 2 weeks ago

Thanks for the feature request @sky-code, I've added to one of our backlogs.