feat: force usage of ServiceWithSource in contrib#4549
Conversation
| // // Create a root span. | ||
| // span, ctx := tracer.StartSpanFromContext(context.Background(), "parent.request", | ||
| // tracer.SpanType(ext.SpanTypeWeb), | ||
| // tracer.ServiceName("web"), |
There was a problem hiding this comment.
removed the suggestion as it's not a recommended pattern
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: dee5ad9 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
🚀 New features to boost your workflow:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 066b179649
ℹ️ 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".
| } | ||
| if cfg.ServiceName != "" { | ||
| opts = append(opts, tracer.ServiceName(cfg.ServiceName)) | ||
| opts = append(opts, instrumentation.ServiceNameWithSource(cfg.ServiceName, cfg.ServiceSource)) |
There was a problem hiding this comment.
Preserve service source when span options override service
Using ServiceNameWithSource here can produce an incorrect _dd.svc_src when callers pass WithSpanOptions(tracer.ServiceName(...)) to WrapClient/WrapRoundTripper: the later span option overwrites the service name, but the source set by this call remains from cfg.ServiceSource, so the final span reports the wrong origin for the effective service override. This affects service-precedence behavior for any client instrumentation that customizes service via span options.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
if customer add in addition of the config an option to set a service name, anwyways it will override the service name and source downstream (when patching tracer.ServiceName in following PR)
BenchmarksBenchmark execution time: 2026-03-16 20:18:44 Comparing candidate commit dee5ad9 in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 157 metrics, 6 unstable metrics.
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Motivation
Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.Unsure? Have a question? Request a review!