Skip to content
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

ddtrace/tracer: more accurate retry logging #3327

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jstern
Copy link

@jstern jstern commented Mar 20, 2025

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
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.

1 participant