-
Notifications
You must be signed in to change notification settings - Fork 197
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
span: Add config setting exit_span_min_duration
#1138
span: Add config setting exit_span_min_duration
#1138
Conversation
Adds a new configuration setting which drops discardable exit spans when their duration is lower or equal than `exit_span_min_duration`. If span compression is enabled, the duration of the composite is considered. This setting drops the spans after they have ended in contrast with the existing `transaction_max_spans` which drops them from the start. The existing a new `configutil.ParseDurationOptions` has been introduced which allows specifying a custom unit as the minimum duration. Signed-off-by: Marc Lopez Rubio <[email protected]>
Updates the `end()` private method and moves the compression attempts to the Public function so that every iteration of `cachedSpan.end()` does not have to go through that logic again. Moves the `s.dropped` logic to the private `end` function since it now needs to check if the span is discardable on every span end, but only after the compression cache has been evicted. Most of the lock acquisition has been moved out of the `end()` function and onto the public `End()`. The main reason is because the transaction may call `cachedSpan.End()` with a different set of locks acquired vs `span.End()`. Last, fixes a small bug where `transaction.dropped_spans_stats.outcome` was empty if the outcome hadn't been set in the modelwriter. Signed-off-by: Marc Lopez Rubio <[email protected]>
Signed-off-by: Marc Lopez Rubio <[email protected]>
Signed-off-by: Marc Lopez Rubio <[email protected]>
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
Signed-off-by: Marc Lopez Rubio <[email protected]>
Signed-off-by: Marc Lopez Rubio <[email protected]>
span.go
Outdated
s.setStacktrace(1) | ||
} | ||
|
||
if s.tx != nil { | ||
s.reportSelfTime() |
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.
What do you think about removing the locking of s.parent/s.tx from reportSelfTime and attemptCompress, and adding those locks toSpan.End? Then we can move this reportSelfTime call to the s.tx != nil
block below.
Signed-off-by: Marc Lopez Rubio <[email protected]>
Signed-off-by: Marc Lopez Rubio <[email protected]>
Seems like versions <= go 1.10 started failing because of the
EDIT: This is the commit that seems to have broken the build: mattn/go-sqlite3@5671e01#diff-66d608cc54b91bcae2b1f650ee68243c099d7b81bcb7a6a88292a94798580185. |
Signed-off-by: Marc Lopez Rubio <[email protected]>
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.
Implementation looks good. I'm struggling a bit to follow the tests, but I probably just need some time to get used to them. One question and a couple of nits, otherwise LGTM
Signed-off-by: Marc Lopez Rubio <[email protected]>
@axw Added a few comments on the tests and updated the transaction's counters:
With these changes, dropping fast exit spans will not decrement the spansCreated count so that it reflects the spans that will be reported to the |
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.
LGTM, just one possible minor simplification.
Signed-off-by: Marc Lopez Rubio <[email protected]>
Signed-off-by: Marc Lopez Rubio <[email protected]>
Description
Adds a new configuration setting which drops discardable exit spans when
their duration is lower or equal than
exit_span_min_duration
. If spancompression is enabled, the duration of the composite is considered.
This setting drops the spans after they have ended in contrast with the
existing
transaction_max_spans
which drops them from the start.The existing a new
configutil.ParseDurationOptions
has been introducedwhich allows specifying a custom unit as the minimum duration.
Updates the
end()
private method and moves the compression attempts tothe Public function so that every iteration of
cachedSpan.end()
doesnot have to go through that logic again.
Moves the
s.dropped
logic to the privateend
function since it nowneeds to check if the span is discardable on every span end, but only
after the compression cache has been evicted.
Most of the lock acquisition has been moved out of the
end()
functionand onto the public
End()
. The main reason is because the transactionmay call
cachedSpan.End()
with a different set of locks acquired vsspan.End()
.Last, fixes a small bug where
transaction.dropped_spans_stats.outcome
was empty if the outcome hadn't been set in the modelwriter.
Related issues
Closes #1112