You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tracer): skip stats concentrator in OTLP export mode (#4609)
### What does this PR do?
Introduces a `statsConcentrator` interface with a `noopConcentrator` implementation so the tracer skips stats computation in OTLP export mode.
- `tracer.stats` is now a `statsConcentrator` interface instead of a concrete `*concentrator.` In OTLP mode it's assigned a `noopConcentrator`; otherwise a real concentrator.
- The non-blocking channel send to `concentrator.In` was moved into a new `trySendSpan` method since interface fields can't expose struct fields — this also encapsulates the channel as an internal detail.
### Motivation:
In OTLP export mode, Datadog-format stats shouldn't be computed or sent. This approach uses a no-op behind an interface so the disabled case is type-safe and can't be broken by forgetting a guard.
### Reviewer's Checklist
<!--
* Authors can use this list as a reference to ensure that there are no problems
during the review but the signing off is to be done by the reviewer(s).
-->
- [ ] Changed code has unit tests for its functionality at or near 100% coverage.
- [ ] [System-Tests](https://github.com/DataDog/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 `make lint` locally.
- [ ] New code doesn't break existing tests. You can check this by running `make test` locally.
- [ ] Add an appropriate team label so this PR gets put in the right place for the release notes.
- [ ] All generated files are up to date. You can check this by running `make generate` locally.
- [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally.
Unsure? Have a question? Request a review!
Co-authored-by: kakkoyun <[email protected]>
Co-authored-by: moezein0 <[email protected]>
Co-authored-by: darccio <[email protected]>
0 commit comments