Skip to content

ddtrace/tracer: more accurate retry logging#3327

Merged
darccio merged 3 commits into
DataDog:mainfrom
jstern:fix-will-retry-message
May 7, 2025
Merged

ddtrace/tracer: more accurate retry logging#3327
darccio merged 3 commits into
DataDog:mainfrom
jstern:fix-will-retry-message

Conversation

@jstern

@jstern jstern commented Mar 20, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

Updates the log messages emitted on failure to send a payload to the agent to just log the current attempt count and total number of attempts that will be made, rather than always including the phrase "will retry".

Motivation

It's a small thing, but the current message can be misleading; if the tracer was not started with a non-zero WithSendRetries option, or if the loop is on the last retry, "will retry" is inaccurate. There might be a nicer change to make to the message but this was the simplest thing I could think of.

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.
  • 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.
  • For internal contributors, a matching PR should be created to the v2-dev branch and reviewed by @DataDog/apm-go.

Unsure? Have a question? Request a review!

When the writer fails to send a payload to the agent, it logs an error message
that includes the text "will retry", but technically this is only true
if the tracer was started with the `WithSendRetries` option (otherwise,
the config value is 0 and no retries will be attempted).

Would it be more accurate/less confusing to do something like this where
the writer just logs "attempt N of M"?
@jstern
jstern requested a review from a team as a code owner March 20, 2025 21:50
@darccio
darccio changed the base branch from main to v1-maintenance April 3, 2025 13:59
@darccio
darccio changed the base branch from v1-maintenance to main May 7, 2025 10:49
@darccio
darccio enabled auto-merge (squash) May 7, 2025 10:49
@darccio
darccio merged commit 58a037b into DataDog:main May 7, 2025
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.

2 participants