-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tracer] Introduce async configuration for test mode to use standard writer when needed #3158
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #3158 +/- ##
===========================================
+ Coverage 0 98.18% +98.18%
===========================================
Files 0 1284 +1284
Lines 0 74105 +74105
Branches 0 3427 +3427
===========================================
+ Hits 0 72757 +72757
- Misses 0 1348 +1348
... and 1271 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
marcotc
approved these changes
Sep 26, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR extends Tracer's configurability:
settings.tracing.test_mode.async
configuration is added. Whenasync
is set to true, Datadog::Tracer is created with async writer (currentlyDatadog::Tracing::Writer
) in test modeDatadog::Tracing::Writer
andDatadog::Tracing::Workers::TraceWriter
)Motivation:
Sometimes SyncWriter can cause performance issues in test mode for several reasons:
An example when this behaviour is problematic is CI visibility library that uses Tracer in test mode in order to disable sampling and guarantee traces delivery.
See how this configuration is used here:
Tracing's test mode is set to use async and we provide a large number as shutdown timeout for the worker to make sure that leftover traces are delivered after test suite run has ended.
Pros of this approach
Cons of this approach
Alternative approaches
Datadog::Tracing::Sampler
configurable and public which brings its own set of challenges and issuesHow to test the change?
Tested in DataDog/datadog-ci-rb#33 by running sidekiq/sidekiq test suite with local versions of ddtrace + datadog-ci and agentless mode enabled
For Datadog employees:
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance
.Unsure? Have a question? Request a review!