Skip to content

fix(ddtrace/tracer): fix UDS handling in WithAgentURL (#3553)#3554

Merged
darccio merged 3 commits into
mainfrom
dario.castane/issue-3553
May 28, 2025
Merged

fix(ddtrace/tracer): fix UDS handling in WithAgentURL (#3553)#3554
darccio merged 3 commits into
mainfrom
dario.castane/issue-3553

Conversation

@darccio

@darccio darccio commented May 27, 2025

Copy link
Copy Markdown
Member

What does this PR do?

Changes how WithAgentURL handles Unix Data Sockets paths. It creates a helper function and tags some places where it could be used.

Motivation

Fix #3553

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 golangci-lint run 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!

@darccio
darccio requested review from a team as code owners May 27, 2025 15:23
@darccio
darccio requested a review from vitor-de-araujo May 27, 2025 15:23
Comment thread internal/uds.go Outdated
@pr-commenter

pr-commenter Bot commented May 27, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-05-28 07:59:48

Comparing candidate commit f386b18 in PR branch dario.castane/issue-3553 with baseline commit 0c7fa4b in branch main.

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

@mtoffl01 mtoffl01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, some suggestions -

  1. UnixURL may be a good alternative name to UDSURL
  2. Although unlikely in the real world, it might be good to add a test case when path is nil?
  3. IMO you might as well migrate all the // TODO(darccio): use internal.UDSURL instead to actually use the new helper function rather than leaving it as a TODO. I would understand if this is just a safety measure to enable v2 release, though

@darccio

darccio commented May 28, 2025

Copy link
Copy Markdown
Member Author

I agree with the naming suggestion, I wasn't inspired at the moment. Just a few comments:

Although unlikely in the real world, it might be good to add a test case when path is nil?

That shouldn't be possible, path string wouldn't allow a nil value. ITOH, there is a test for blank value.

IMO you might as well migrate all the // TODO(darccio): use internal.UDSURL instead to actually use the new helper function rather than leaving it as a TODO. I would understand if this is just a safety measure to enable v2 release, though.

It is a safety measure to avoid introducing side effects for v2 release.

@darccio
darccio enabled auto-merge (squash) May 28, 2025 07:50
@darccio
darccio merged commit 0fcee3d into main May 28, 2025
@darccio
darccio deleted the dario.castane/issue-3553 branch May 28, 2025 08:05
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.

[BUG]: Invalid handling of unix:/... URLs in WithAgentURL

5 participants