Open JonasBa opened 5 months ago
Before Continuous Profiling gets added, does Sentry allow programmatically creating a Profile? i.e if a User clicks on a button in our application would we be able to create a Profile that tracks what happens for the next 5 seconds?
@kennethtruong we do, but since profiles are currently tied to the transaction model, it means you need to start a span and then take care of stopping it at some point in time. You should be able to do this using inactive spans and then calling span.end()
using a timeout.
@kennethtruong we do, but since profiles are currently tied to the transaction model, it means you need to start a span and then take care of stopping it at some point in time. You should be able to do this using inactive spans and then calling span.end() using a timeout.
Ah nice let me try that out! Thank you
Problem Statement
We want to decouple profiles from the current transaction model and expose a way for users to profile code that is longer than 30s (current max profile duration )
Solution Brainstorm
Introduce a continuous profiling mode.
The continuous profiling mode is exclusive from the current profiling mode. We want to allow developers to start and stop the profiler as they please, yielding full control over what is profiled. The current API design docs are here and have not been finalized.
An implementation details of the continuous profiling mode is that each span that is started during a profiling session has a profile context that includes the thread id, name and the profiler id that was currently active (we need this so we can stitch back the profile chunks back together.
Fwiw, the product is currently not handling this yet as we do not have a way to visualize continuous profiles yet. The plan is to implement the functionality and keep it hidden while we work on the in-product support for this.