[API] Skip exception formatting on unrecorded spans
Merged
MA
3mo ago+46+46+01234567890123456789-3-3-0123456789
Changes
Skips extracting and formatting exception fields, generating a stack trace, and creating span attributes when the span is not recorded.
| IsRecording = false | Before | After |
|---|---|---|
| RecordException(Exception) with deep stack | 69.58 µs / 100,263 B | 0.80 ns / 0 B |
| RecordException(string, string, string) | 42.26 ns / 144 B | 0.98 ns / 0 B |
Merge requirement checklist
- CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
- Unit tests added/updated
- Appropriate
CHANGELOG.mdfiles updated for non-trivial changes - Changes in public API reviewed (if applicable)