Skip to content

Conversation

hannahkm
Copy link
Contributor

@hannahkm hannahkm commented Aug 1, 2025

What does this PR do?

  • Creates a new tag, ErrorNoStackTrace, to report errors without capturing the stack trace for our UI.
  • Better aligns our error tags with Error Tracking. This includes moving error.stack to error.handling_stack, moving error.details into error.stack, and deprecating error.details.

Motivation

We were creating errors and reporting the stack for status code errors. For new error stack features (#3709), this causes us to create two error stacks: one starting from SetTag and one started from error creation. To avoid this, and also because reporting these error stacks is superfluous, we want to prevent reporting these stacks to hide them from our UI.

For information on what each tag represents, refer to this (internal) page.

IMPORTANT: this might be considered a breaking change for Error Tracking. Please check with the ET team before releasing this feature.

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-09-24 14:35:03

Comparing candidate commit 4fefb03 in PR branch hannahkm/new-error-tag with baseline commit e2c8d45 in branch main.

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

scenario:BenchmarkSetTagStringPtr-24

  • 🟥 execution_time [+5.953ns; +9.007ns] or [+4.261%; +6.447%]

@hannahkm hannahkm marked this pull request as ready for review September 12, 2025 14:57
@hannahkm hannahkm requested review from a team as code owners September 12, 2025 14:57
@hannahkm hannahkm requested a review from kakkoyun September 12, 2025 14:57
ErrorStack = "error.stack"

// ErrorHandlingStack specifies the stack dump when the error is captured.
ErrorHandlingStack = "error.handling_stack"
Copy link
Member

Choose a reason for hiding this comment

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

We are adding these two new tags, what are the implications on the ingestion side? Especially for error tracking?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new tags will change the behavior of error tags on spans; handling_stack should already be handled from the error tracking side, but we just haven't been taking advantage of it earlier. The fingerprints of spans will change after we release this PR, so we should give them a heads-up before so that they can adjust in the backend.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the explanation ☺️

@hannahkm
Copy link
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Sep 24, 2025

View all feedbacks in Devflow UI.

2025-09-24 14:34:41 UTC ℹ️ Start processing command /merge


2025-09-24 14:34:51 UTC ℹ️ MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-09-24 18:35:08 UTC ⚠️ MergeQueue: This merge request was unqueued

devflow unqueued this merge request: It did not become mergeable within the expected time

Copy link

datadog-official bot commented Sep 24, 2025

⚠️ Tests

⚠️ Warnings

❄️ 1 New flaky test detected

TestWrapConsumerGroupHandler from github.com/DataDog/dd-trace-go/contrib/IBM/sarama/v2 (Datadog) (✨ Fix with BitsAI)
Failed

=== RUN   TestWrapConsumerGroupHandler
2025/09/24 14:48:13 Sarama consumer up and running!...
    consumer_group_test.go:146: Message claimed: value = test 1, timestamp = 2025-09-24 14:48:13.724 +0000 UTC, topic = IBM_sarama_TestWrapConsumerGroupHandler
    consumer_group_test.go:88: 
        	Error Trace:	/home/runner/work/dd-trace-go/dd-trace-go/contrib/IBM/sarama/consumer_group_test.go:88
        	Error:      	"[
        	            	name: kafka.produce
        	            	tags: map[string]interface {}{"_dd.base_service":"", "_dd.p.tid":"68d404ad00000000", "_dd.profiling.enabled":0, "_dd.top_level":1, "component":"IBM/sarama", "language":"go", "messaging.destination.name":"IBM_sarama_TestWrapConsumerGroupHandler", "messaging.kafka.partition":0, "messaging.system":"kafka", "offset":0, "resource.name":"Produce Topic IBM_sarama_TestWrapConsumerGroupHandler", "service.name":"kafka", "span.kind":"producer", "span.name":"kafka.produce", "span.type":"queue"}
...

ℹ️ Info

🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4fefb03 | Docs | Was this helpful? Give us feedback!

@hannahkm
Copy link
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Sep 24, 2025

View all feedbacks in Devflow UI.

2025-09-24 18:41:37 UTC ℹ️ Start processing command /merge


2025-09-24 18:41:42 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 18m (p90).


2025-09-24 18:56:35 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit 64ea958 into main Sep 24, 2025
261 of 269 checks passed
@dd-mergequeue dd-mergequeue bot deleted the hannahkm/new-error-tag branch September 24, 2025 18:56
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 mergequeue-status: done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants