-
Notifications
You must be signed in to change notification settings - Fork 273
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
Add the EnsureTrace prioritization strategy. #1841
Add the EnsureTrace prioritization strategy. #1841
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to use the enum values to drive the configuration
@@ -537,8 +539,20 @@ private static Writer createWriter( | |||
TimeUnit.SECONDS.toMillis(config.getAgentTimeout()), | |||
Config.get().isTraceAgentV05Enabled()); | |||
|
|||
final String prioritizationType = config.getPrioritizationType(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you rebase off master there is a configProvider.getEnum
which would clean this up I think. The configuration parameter would be defined by the enum values themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we commented offline, there is no a configProvider
instance in CoreTracer
yet. This will be refactored in the future.
...l-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/PrioritizationConstants.java
Show resolved
Hide resolved
6e86396
to
f74f520
Compare
@@ -10,33 +10,87 @@ | |||
import java.util.concurrent.TimeUnit; | |||
|
|||
public enum Prioritization { | |||
ENSURE_TRACE { | |||
@Override | |||
public PrioritizationStrategy create( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think rather than Queue; this should either be...
create(Queue primary, Queue secondary)
OR
create(Queue<List> primary, Queue<List> secondary)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a discussion about this at the time. Accepting Object
allows the flush messages and avoids allocating wrappers, but it has downsides, so we don't want this ever escaping the package.
Added a new
PrioritizationStrategy
tries to offer the trace to the primary queue until thequeue.offer(...)
method returns true. This type can be configured viaConfig
.This new type is needed to avoid losing spans in CI/Tests traces. It should not be used in applications in production mode.