Skip to content

feat: do not report error stack for status code errors #3837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hannahkm
Copy link
Contributor

@hannahkm hannahkm commented Aug 1, 2025

What does this PR do?

Motivation

Reviewer's Checklist

  • 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 ./scripts/lint.sh locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • 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!

@github-actions github-actions bot added the apm:ecosystem contrib/* related feature requests or bugs label Aug 1, 2025
@pr-commenter
Copy link

pr-commenter bot commented Aug 1, 2025

Benchmarks

Benchmark execution time: 2025-08-05 17:33:50

Comparing candidate commit 5e13bf3 in PR branch hannahkm/new-error-tag with baseline commit 80c9990 in branch main.

Found 0 performance improvements and 1 performance regressions! Performance is the same for 2 metrics, 0 unstable metrics.

scenario:BenchmarkSetTagString-24

  • 🟥 execution_time [+5.024ns; +8.376ns] or [+4.474%; +7.458%]

}
return
}
if !cfg.noDebugStack {
s.setMeta(ext.ErrorStack, takeStacktrace(cfg.stackFrames, cfg.stackSkip))
telemetry.Count(telemetry.NamespaceTracers, "errorstack.source", []string{"source:takeStacktrace"}).Submit(1)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

takeStacktrace is now being called from line 449 to calculate the handling stack. In order to avoid double counting how many errors are relying on takeStacktrace to get the error stack, we move the telemetry counter from line 466 to here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant