[API] Skip exception formatting on unrecorded spans

Merged
MA
3mo ago
+46-3

Changes

Skips extracting and formatting exception fields, generating a stack trace, and creating span attributes when the span is not recorded.

IsRecording = falseBeforeAfter
RecordException(Exception) with deep stack69.58 µs / 100,263 B0.80 ns / 0 B
RecordException(string, string, string)42.26 ns / 144 B0.98 ns / 0 B

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)