Skip to content

Conversation

@lym953
Copy link
Contributor

@lym953 lym953 commented Jan 9, 2026

Problem

Span dedup service sometimes fails to return the result and thus logs the error:

DD_EXTENSION | ERROR | Failed to send check_and_add response: true

I see this error in our Self Monitoring and a customer's account.
Also I believe it causes extension to fail to receive traces from the tracer, causing missing traces. This is because the caller of span dedup is in process_traces(), which is the function that handles the tracer's HTTP request to send traces. If this function fails to get span dedup result and gets stuck, the HTTP request will time out.

This PR

While I don't yet know what causes the error, this PR adds a patch to mitigate the impact:

  1. Change log level from error to warn
  2. Add a timeout of 5 seconds to the span dedup check, so that if the caller doesn't get an answer soon, it defaults to treating the trace as not a duplicate, which is the most common case.

Testing

To merge this PR then check log in self monitoring, as it's hard to run high-volume tests in self monitoring from a non-main branch.

@lym953 lym953 marked this pull request as ready for review January 9, 2026 19:37
@lym953 lym953 requested a review from a team as a code owner January 9, 2026 19:37
@litianningdatadog
Copy link
Contributor

As the dedup service is accumulating more hardcoded configurations (such as capacity and timeouts), it would be beneficial to pass these in as configurable parameters in a follow-up, so they can be adjusted without requiring code changes.

@lym953
Copy link
Contributor Author

lym953 commented Jan 12, 2026

@litianningdatadog That's a good suggestion, but I don't see a need for it right now. I'm still not sure why the response fails to be sent, and this PR is just a short-term patch. If we can figure out and fix the root cause, then maybe we can remove the timeout.

Copy link
Contributor

@litianningdatadog litianningdatadog left a comment

Choose a reason for hiding this comment

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

LGTM

@lym953 lym953 merged commit a21890b into main Jan 13, 2026
50 checks passed
@lym953 lym953 deleted the yiming.luo/span-dedup-timeout branch January 13, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants