sentry-docs icon indicating copy to clipboard operation
sentry-docs copied to clipboard

Add Profile to Transaction

Open thinkocapo opened this issue 1 year ago • 1 comments

Core or SDK?

Core Sentry product

Which part? Which one?

Add Profile to Custom Transaction

Description

Need it for Android but probably a good idea for all SDK's.

We have Android's documentation for Custom Instrumentation we have:

  • Add More Spans to the Transaction
  • Create Transaction Bound to The Current Scope
  • Connect Errors with Spans So how about for
  • Add Profile to the Custom Transaction :)

Image

Overall Approach:

  1. start a custom transaction [docs say transaction, not span]
  2. [profile will start being recorded for this transaction? :point_up:]
  3. [must create a 'profile' obj, do profile.start() and attach it to the transaction obj? How?]
  4. end the custom transaction [and this will auto-finish the open profile?]

Suggested Solution

Overall Approach:

  1. start a custom transaction [docs say transaction, not span]
  2. profile starts being recorded (assuming they have SDK Profiling enabled)
  3. end the custom transaction and this ends the profile

Can open the Trace/Transaction in Sentry and then view the profile. It should cover the same duration of the parent span (the transaction).

thinkocapo avatar Aug 16 '24 12:08 thinkocapo

Assigning to @getsentry/support for routing ⏲️

getsantry[bot] avatar Aug 16 '24 12:08 getsantry[bot]