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

feat: Auto Instrumentation for Awake

Open bitsandfoxes opened this issue 3 years ago • 1 comments
trafficstars

The idea is to start and finish spans automatically for every Awake method in all MonoBehaviour within the project. Noticeable pitfall: Not every MonoBehaviour implements Awake.

The plan:

  • [x] Hook up to the compilation pipeline to get the Assembly-CSharp.dll
  • [x] Add options flag to enable/disable feature and put it on the window
  • [x] Insert Start Span as the very first instruction
  • [x] Insert Finish Span before every return
  • [x] Enable Trace Sample Rate for smoke testing
  • [x] Enable Performance Auto Instrumentation for smoke testing
  • [x] Smoke test looking for a app.start transaction
  • [x] Smoke test looking for awake span

bitsandfoxes avatar Oct 04 '22 15:10 bitsandfoxes

Messages
:book: Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by :no_entry_sign: dangerJS against 6b08bf19fbe79456842cbee599daa3ab01ac4018

github-actions[bot] avatar Oct 04 '22 15:10 github-actions[bot]

Generally looks good. Commented with some minor nits.

Didn't test it out though - I'd need more context.

mattjohnsonpint avatar Oct 27 '22 06:10 mattjohnsonpint