You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changed code has unit tests for its functionality at or near 100% coverage.
System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
There is a benchmark for any new code, or changes to existing code.
If this interacts with the agent in a new way, a system test has been added.
New code is free of linting errors. You can check this by running make lint locally.
New code doesn't break existing tests. You can check this by running make test locally.
Add an appropriate team label so this PR gets put in the right place for the release notes.
All generated files are up to date. You can check this by running make generate locally.
Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running make fix-modules locally.
TestSetStatusShouldNotOverwriteUserDefinedErrorFields from github.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry (Datadog) (Fix with Cursor)
Failed
=== RUN TestSetStatusShouldNotOverwriteUserDefinedErrorFields
--- FAIL: TestSetStatusShouldNotOverwriteUserDefinedErrorFields (0.01s)
TestSetStatusShouldNotOverwriteUserDefinedErrorFields/all_error_fields_are_overwritten_when_SetStatus_is_called from github.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry (Datadog) (Fix with Cursor)
Failed
=== RUN TestSetStatusShouldNotOverwriteUserDefinedErrorFields/all_error_fields_are_overwritten_when_SetStatus_is_called
span_test.go:475:
Error Trace: D:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span_test.go:475
Error: "map[_dd.p.dm:-1 _dd.p.tid:69bd499f00000000 _dd.tags.process:entrypoint.basedir:b539,entrypoint.name:opentelemetry.test.exe,entrypoint.type:executable,entrypoint.workdir:opentelemetry error.handling_stack:github.com/DataDog/dd-trace-go/v2/internal/stacktrace.SkipAndCaptureWithInternalFrames\n\tD:/a/dd-trace-go/dd-trace-go/internal/stacktrace/stacktrace.go:274\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.takeStacktrace\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:719\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.(*Span).setTagErrorLocked\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:692\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.(*Span).Finish\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:921\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry.(*span).End\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span.go:98\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry.TestSetStatusShouldNotOverwriteUserDefinedErrorFields.func1\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span_test.go:464\ntesting.tRunner\n\tC:/hostedtoolcache/windows/go/1.26.1/x64/src/testing/testing.go:2036\nruntime.goexit\n\tC:/hostedtoolcache/windows/go/1.26.1/x64/src/runtime/asm_amd64.s:1771 error.message:status description from SetStatus error.stack:custom stack trace error.type:*errors.errorString language:go runtime-id:23fdd18c-07d0-4230-97fc-5b7a22f08a1f span.kind:internal]" does not contain "custom error message"
Test: TestSetStatusShouldNotOverwriteUserDefinedErrorFields/all_error_fields_are_overwritten_when_SetStatus_is_called
span_test.go:475:
Error Trace: D:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span_test.go:475
Error: "map[_dd.p.dm:-1 _dd.p.tid:69bd499f00000000 _dd.tags.process:entrypoint.basedir:b539,entrypoint.name:opentelemetry.test.exe,entrypoint.type:executable,entrypoint.workdir:opentelemetry error.handling_stack:github.com/DataDog/dd-trace-go/v2/internal/stacktrace.SkipAndCaptureWithInternalFrames\n\tD:/a/dd-trace-go/dd-trace-go/internal/stacktrace/stacktrace.go:274\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.takeStacktrace\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:719\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.(*Span).setTagErrorLocked\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:692\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.(*Span).Finish\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:921\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry.(*span).End\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span.go:98\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry.TestSetStatusShouldNotOverwriteUserDefinedErrorFields.func1\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span_test.go:464\ntesting.tRunner\n\tC:/hostedtoolcache/windows/go/1.26.1/x64/src/testing/testing.go:2036\nruntime.goexit\n\tC:/hostedtoolcache/windows/go/1.26.1/x64/src/runtime/asm_amd64.s:1771 error.message:status description from SetStatus error.stack:custom stack trace error.type:*errors.errorString language:go runtime-id:23fdd18c-07d0-4230-97fc-5b7a22f08a1f span.kind:internal]" does not contain "custom.ErrorType"
...
TestSetStatusShouldNotOverwriteUserDefinedErrorFields/error.message_is_overwritten_by_SetStatus_description from github.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry (Datadog) (Fix with Cursor)
Failed
=== RUN TestSetStatusShouldNotOverwriteUserDefinedErrorFields/error.message_is_overwritten_by_SetStatus_description
span_test.go:475:
Error Trace: D:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span_test.go:475
Error: "map[_dd.p.dm:-1 _dd.p.tid:69bd499f00000000 _dd.tags.process:entrypoint.basedir:b539,entrypoint.name:opentelemetry.test.exe,entrypoint.type:executable,entrypoint.workdir:opentelemetry error.handling_stack:github.com/DataDog/dd-trace-go/v2/internal/stacktrace.SkipAndCaptureWithInternalFrames\n\tD:/a/dd-trace-go/dd-trace-go/internal/stacktrace/stacktrace.go:274\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.takeStacktrace\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:719\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.(*Span).setTagErrorLocked\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:692\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.(*Span).Finish\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:921\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry.(*span).End\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span.go:98\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry.TestSetStatusShouldNotOverwriteUserDefinedErrorFields.func1\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span_test.go:464\ntesting.tRunner\n\tC:/hostedtoolcache/windows/go/1.26.1/x64/src/testing/testing.go:2036\nruntime.goexit\n\tC:/hostedtoolcache/windows/go/1.26.1/x64/src/runtime/asm_amd64.s:1771 error.message:status description from SetStatus error.type:*errors.errorString language:go runtime-id:23fdd18c-07d0-4230-97fc-5b7a22f08a1f span.kind:internal]" does not contain "custom error message"
Test: TestSetStatusShouldNotOverwriteUserDefinedErrorFields/error.message_is_overwritten_by_SetStatus_description
span_test.go:478:
Error Trace: D:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span_test.go:478
Error: "map[_dd.p.dm:-1 _dd.p.tid:69bd499f00000000 _dd.tags.process:entrypoint.basedir:b539,entrypoint.name:opentelemetry.test.exe,entrypoint.type:executable,entrypoint.workdir:opentelemetry error.handling_stack:github.com/DataDog/dd-trace-go/v2/internal/stacktrace.SkipAndCaptureWithInternalFrames\n\tD:/a/dd-trace-go/dd-trace-go/internal/stacktrace/stacktrace.go:274\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.takeStacktrace\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:719\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.(*Span).setTagErrorLocked\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:692\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.(*Span).Finish\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:921\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry.(*span).End\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span.go:98\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry.TestSetStatusShouldNotOverwriteUserDefinedErrorFields.func1\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span_test.go:464\ntesting.tRunner\n\tC:/hostedtoolcache/windows/go/1.26.1/x64/src/testing/testing.go:2036\nruntime.goexit\n\tC:/hostedtoolcache/windows/go/1.26.1/x64/src/runtime/asm_amd64.s:1771 error.message:status description from SetStatus error.type:*errors.errorString language:go runtime-id:23fdd18c-07d0-4230-97fc-5b7a22f08a1f span.kind:internal]" should not contain "status description from SetStatus"
...
TestSetStatusShouldNotOverwriteUserDefinedErrorFields/error.type_is_overwritten_by_SetStatus_description from github.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry (Datadog) (Fix with Cursor)
Failed
=== RUN TestSetStatusShouldNotOverwriteUserDefinedErrorFields/error.type_is_overwritten_by_SetStatus_description
span_test.go:475:
Error Trace: D:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span_test.go:475
Error: "map[_dd.p.dm:-1 _dd.p.tid:69bd499f00000000 _dd.tags.process:entrypoint.basedir:b539,entrypoint.name:opentelemetry.test.exe,entrypoint.type:executable,entrypoint.workdir:opentelemetry error.handling_stack:github.com/DataDog/dd-trace-go/v2/internal/stacktrace.SkipAndCaptureWithInternalFrames\n\tD:/a/dd-trace-go/dd-trace-go/internal/stacktrace/stacktrace.go:274\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.takeStacktrace\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:719\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.(*Span).setTagErrorLocked\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:692\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.(*Span).Finish\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:921\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry.(*span).End\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span.go:98\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry.TestSetStatusShouldNotOverwriteUserDefinedErrorFields.func1\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span_test.go:464\ntesting.tRunner\n\tC:/hostedtoolcache/windows/go/1.26.1/x64/src/testing/testing.go:2036\nruntime.goexit\n\tC:/hostedtoolcache/windows/go/1.26.1/x64/src/runtime/asm_amd64.s:1771 error.message:status description from SetStatus error.type:*errors.errorString language:go runtime-id:23fdd18c-07d0-4230-97fc-5b7a22f08a1f span.kind:internal]" does not contain "custom.ErrorType"
Test: TestSetStatusShouldNotOverwriteUserDefinedErrorFields/error.type_is_overwritten_by_SetStatus_description
span_test.go:478:
Error Trace: D:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span_test.go:478
Error: "map[_dd.p.dm:-1 _dd.p.tid:69bd499f00000000 _dd.tags.process:entrypoint.basedir:b539,entrypoint.name:opentelemetry.test.exe,entrypoint.type:executable,entrypoint.workdir:opentelemetry error.handling_stack:github.com/DataDog/dd-trace-go/v2/internal/stacktrace.SkipAndCaptureWithInternalFrames\n\tD:/a/dd-trace-go/dd-trace-go/internal/stacktrace/stacktrace.go:274\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.takeStacktrace\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:719\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.(*Span).setTagErrorLocked\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:692\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/tracer.(*Span).Finish\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/span.go:921\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry.(*span).End\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span.go:98\ngithub.com/DataDog/dd-trace-go/v2/ddtrace/opentelemetry.TestSetStatusShouldNotOverwriteUserDefinedErrorFields.func1\n\tD:/a/dd-trace-go/dd-trace-go/ddtrace/opentelemetry/span_test.go:464\ntesting.tRunner\n\tC:/hostedtoolcache/windows/go/1.26.1/x64/src/testing/testing.go:2036\nruntime.goexit\n\tC:/hostedtoolcache/windows/go/1.26.1/x64/src/runtime/asm_amd64.s:1771 error.message:status description from SetStatus error.type:*errors.errorString language:go runtime-id:23fdd18c-07d0-4230-97fc-5b7a22f08a1f span.kind:internal]" should not contain "*errors.errorString"
...
This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 818bf59 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!
Comparing candidate commit 818bf59 in PR branch rarguelloF/fix-otel-override-custom-errors with baseline commit 5160dbf in branch main.
Found 0 performance improvements and 0 performance regressions! Performance is the same for 156 metrics, 8 unstable metrics.
Explanation
This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:
🟩 = significantly better candidate vs. baseline
🟥 = significantly worse candidate vs. baseline
We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.
If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.
Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.
More details about the CI and significant changes
You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.
CIs of the difference of means are often centered around 0%, because often changes are not that big:
---------------------------------(------|---^--------)-------------------------------->
-0.6% 0% 0.3% +1.2%
| | |
lower bound of the CI --' | |
sample mean (center of the CI) -------------' |
upper bound of the CI ----------------------'
As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).
For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:
----------------------------------------|---------|---(---------^---------)---------->
0% 1% 1.3% 2.2% 3.1%
| | | |
significant impact threshold --------------' | | |
lower bound of CI --------------' | |
sample mean (center of the CI) --------------------------' |
upper bound of CI ----------------------------------'
rarguelloF
changed the title
fix: do not override otel custom errors
fix(ddtrace/opentelemetry): do not override otel custom errors
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
#3708
Motivation
Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.Unsure? Have a question? Request a review!