-
Notifications
You must be signed in to change notification settings - Fork 314
Introduced trace post-processing #6800
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
Changes from all commits
bfe73e9
da1e19b
8ac8c0e
d70d1cf
2dc3605
81bd615
a7ccdef
ed04cb2
96342ff
749f577
ae1ecea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package datadog.trace.core.postprocessor; | ||
|
|
||
| import datadog.trace.core.DDSpan; | ||
| import java.util.function.BooleanSupplier; | ||
|
|
||
| /** | ||
| * Span Post-processing with a timeout check capability. | ||
| * | ||
| * <p>Implementations of this interface should carry out post-processing of spans while supporting | ||
| * interruption when a specified time limit is exceeded. The method {@code process} must check the | ||
| * state of {@code timeoutCheck} while processing span. If {@code timeoutCheck.getAsBoolean()} | ||
| * returns {@code true}, processing should be immediately halted, and the method should return | ||
| * {@code false}. If post-processing completes successfully before the timeout, the method should | ||
| * return {@code true}. | ||
| */ | ||
| public interface SpanPostProcessor { | ||
mcculls marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /** | ||
| * Post-processes a span. | ||
| * | ||
| * @param span The span to be post-processed. | ||
| * @param timeoutCheck A timeout check returning {@code true} if the allotted time has elapsed. | ||
| * @return {@code true} if the span was successfully processed; {@code false} in case of a | ||
| * timeout. | ||
| */ | ||
| boolean process(DDSpan span, BooleanSupplier timeoutCheck); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the BooleanSupplier? Would it not be better to just have two different methods to cover the two different cases? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea of the supplier was for situations where the processor was doing something non-trivial - assuming that processing could be broken down into smaller chunks then the supplier would allow it to check to see if the timeout had been exceeded mid-processing (otherwise there's no easy way for a processor to check to see if it should abort its processing) In other words during the This is only really needed when the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, that makes sense. Thanks for the clarification. |
||
| } | ||
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 don't particularly like that these methods are public.
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.
In my case,
setRequiresPostProcessing, should be called fromappsecmodule, so we need to expose it in some way. Either inTraceSegmet, either inDDSpanContext.Do you have any other options in mind?