dd-trace-go
dd-trace-go copied to clipboard
feat(ddtrace/tracer): add RecordException API
What does this PR do?
- Add
RecordExceptionAPI in tracer following this RFC. This API adds an error to the current span as a SpanEvent. - Fix span event attributes sanitizer. Currently, it was possible to provide
NaNorInfinitefloat value which would make the trace non loadable in datadog.
I'll open a systemtest PR soon (I'm waiting for support on other languages).
Motivation
Several customers asked for this in other languages and @mtoffl01 told me there was a specific feature request in go.
Reviewer's Checklist
- [x] Changed code has unit tests for its functionality at or near 100% coverage.
- [x] New code is free of linting errors. You can check this by running
golangci-lint runlocally. - [x] Add an appropriate team label so this PR gets put in the right place for the release notes.
- [x] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.
Unsure? Have a question? Request a review!
Benchmarks
Benchmark execution time: 2025-07-07 11:32:28
Comparing candidate commit f299476e0521815b6e1d4806837c72f121b9749b in PR branch dubloom/record-exception-api with baseline commit fb8024210cfa1479d2c074e9626d56085f34883f in branch main.
Found 0 performance improvements and 0 performance regressions! Performance is the same for 24 metrics, 0 unstable metrics.
@dubloom Is this PR alive?