Skip to content

Conversation

@mtoffl01
Copy link
Contributor

@mtoffl01 mtoffl01 commented Dec 17, 2025

What does this PR do?

Migrates tracer to use Config.serviceName instead of its local serviceName.
Note that this PR is narrowly scoped; in the future, we can get rid of setting service name on globalconfig altogether, and likely stop passing in the service name to other products, as these products/packages will just query the Config singleton directly.

Motivation

Go config revamp

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!

Copy link
Contributor Author

mtoffl01 commented Dec 17, 2025

@mtoffl01 mtoffl01 marked this pull request as ready for review December 17, 2025 21:11
@mtoffl01 mtoffl01 requested review from a team as code owners December 17, 2025 21:11
@mtoffl01 mtoffl01 requested review from rachelyangdog and removed request for a team December 17, 2025 21:11
@pr-commenter
Copy link

pr-commenter bot commented Dec 17, 2025

Benchmarks

Benchmark execution time: 2025-12-19 16:24:45

Comparing candidate commit 5d9df19 in PR branch 12-17-migrate_servicename with baseline commit 87da5e8 in branch mtoff/retryInterval.

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

@datadog-official
Copy link
Contributor

datadog-official bot commented Dec 17, 2025

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 1 Test failed

❄️ Known flaky: Test from github.com/DataDog/dd-trace-go/v2/internal/orchestrion/_integration/gorilla_mux (Datadog) (Fix with Cursor)
Failed

=== RUN   Test
    generated_test.go:17: Running setup
    agent.go:78: mockagent: starting
    agent.go:34: mockagent: handling request: /info
    agent.go:44: mockagent: handler not implemented for path: /info
    generated_test.go:17: Running test
    agent.go:103: mockagent: fetching spans
    agent.go:34: mockagent: handling request: /v0.4/traces
...

ℹ️ Info

❄️ No new flaky tests detected

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

@mtoffl01 mtoffl01 marked this pull request as draft December 17, 2025 21:37
@mtoffl01 mtoffl01 mentioned this pull request Dec 17, 2025
7 tasks
@mtoffl01 mtoffl01 force-pushed the mtoff/retryInterval branch from 893a70c to d859bab Compare December 18, 2025 16:56
@mtoffl01 mtoffl01 force-pushed the 12-17-migrate_servicename branch from 6c2a483 to 515a4a5 Compare December 18, 2025 16:56
@mtoffl01 mtoffl01 marked this pull request as ready for review December 18, 2025 19:15
cfg.Env = t.config.internalConfig.Env()
cfg.HTTP = t.config.httpClient
cfg.ServiceName = t.config.serviceName
cfg.ServiceName = t.config.internalConfig.ServiceName()
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that we have gotten rid of the call to getDDorOtelConfig above, why don't we have to use ConfigProvider here?

Copy link
Member

Choose a reason for hiding this comment

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

We're using the ConfigProvider here, the internalConfig is built using the ConfigProvider and then assigned as an attribute of t.config the ServiceName in the internalConfig is picked amongst all possible sources.

@mtoffl01 mtoffl01 changed the base branch from mtoff/retryInterval to graphite-base/4292 December 19, 2025 15:18
@mtoffl01 mtoffl01 force-pushed the 12-17-migrate_servicename branch from 515a4a5 to 5d9df19 Compare December 19, 2025 15:20
@mtoffl01 mtoffl01 changed the base branch from graphite-base/4292 to mtoff/retryInterval December 19, 2025 15:20
@mtoffl01 mtoffl01 closed this Jan 9, 2026
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.

4 participants