Skip to content

Conversation

@darccio
Copy link
Member

@darccio darccio commented Nov 12, 2025

What does this PR do?

Models internal/remoteconfig package's behaviour to mirror how SetGlobalTracer behaves when calling Start() multiple times.

AI generated PR.

Motivation

Fixes #4111.

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!

@darccio darccio self-assigned this Nov 12, 2025
@darccio darccio added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Nov 12, 2025
@darccio darccio requested review from a team as code owners November 12, 2025 15:40
@pr-commenter
Copy link

pr-commenter bot commented Nov 12, 2025

Benchmarks

Benchmark execution time: 2025-11-20 11:39:02

Comparing candidate commit 9cf232b in PR branch dario.castane/langplat-901/duplicate-tracer-start-disables-rc with baseline commit a1926ab in branch main.

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

Copy link
Member

@felixge felixge left a comment

Choose a reason for hiding this comment

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

Gave this a light review, but mostly LGTM.

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Nov 12, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9cf232b | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@darccio
Copy link
Member Author

darccio commented Nov 17, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@darccio darccio force-pushed the dario.castane/langplat-901/duplicate-tracer-start-disables-rc branch from a51499e to e85adca Compare November 18, 2025 16:02
@darccio
Copy link
Member Author

darccio commented Nov 19, 2025

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

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

Looking good.

I believe we can simplify by using a mutex and regular boolean and just closing the client.stop once.

@darccio darccio removed the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Nov 20, 2025
@darccio darccio force-pushed the dario.castane/langplat-901/duplicate-tracer-start-disables-rc branch from e85adca to fa80a57 Compare November 20, 2025 09:26
Copy link
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

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

We need to guard the Reset, I believe.

One other thing we can explore it to have an atomic.Pointer for the global client.

And embed the started logic into the Client since it has already have its own mutex. We can embed the logic in Start() into Client.start() and Start can proxy to it.

We can swap the global client after a successful start.
WDYT?

@darccio
Copy link
Member Author

darccio commented Nov 20, 2025

One other thing we can explore it to have an atomic.Pointer for the global client.

I tested this and it introduced too many changes. I think we need to find a better way to handle multiple products that run when the tracer is started.

@darccio darccio requested a review from kakkoyun November 20, 2025 10:33
@darccio
Copy link
Member Author

darccio commented Nov 20, 2025

/merge

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Nov 20, 2025

View all feedbacks in Devflow UI.

2025-11-20 15:51:25 UTC ℹ️ Start processing command /merge


2025-11-20 15:51:30 UTC ℹ️ MergeQueue: pull request added to the queue

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


2025-11-20 16:08:00 UTC ℹ️ MergeQueue: Readding this merge request to the queue because another merge request processed with yours failed. No action is needed from your side.


2025-11-20 16:27:16 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit 472d9fe into main Nov 20, 2025
247 checks passed
@dd-mergequeue dd-mergequeue bot deleted the dario.castane/langplat-901/duplicate-tracer-start-disables-rc branch November 20, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: duplicate calls to tracer.Start permanently disable remote config

7 participants