Skip to content
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

Promote TraceContext to non-pooled types #478

Merged
merged 1 commit into from Mar 19, 2019
Merged

Conversation

axw
Copy link
Member

@axw axw commented Mar 18, 2019

Move TraceContext from TransactionData to
Transaction, and SpanData to Span. This
enables an ended transaction or span to
be used as the parent of a span. This is
particularly important to enable
fire-and-forget type patterns, where a
goroutine is spawned that may start a span
after the parent ends.

Transactions, spans, and errors are now
all sent to the tracer goroutine through
a single "chan tracerEvent" channel.

This change incurs a minor (~10%/~50 bytes)
increase in the number of bytes allocated
per transaction. There is no change in number
of allocs, and no significant impact on time
per operation.

Partially addresses #475

@codecov-io
Copy link

codecov-io commented Mar 18, 2019

Codecov Report

Merging #478 into master will decrease coverage by 0.63%.
The diff coverage is 92.3%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #478      +/-   ##
==========================================
- Coverage   84.46%   83.82%   -0.64%     
==========================================
  Files         113      112       -1     
  Lines        7164     6733     -431     
==========================================
- Hits         6051     5644     -407     
+ Misses        804      786      -18     
+ Partials      309      303       -6
Impacted Files Coverage Δ
tracer.go 86.5% <100%> (-1.19%) ⬇️
modelwriter.go 95.93% <100%> (+0.83%) ⬆️
error.go 94.88% <100%> (-2.61%) ⬇️
transaction.go 94.64% <100%> (-0.36%) ⬇️
gocontext.go 84.09% <69.56%> (-12.21%) ⬇️
span.go 86.82% <88.57%> (-1.39%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc482e6...d4ce90a. Read the comment docs.

Move TraceContext from TransactionData to
Transaction, and SpanData to Span. This
enables an ended transaction or span to
be used as the parent of a span. This is
particularly important to enable
fire-and-forget type patterns, where a
goroutine is spawned that may start a span
after the parent ends.

Span now holds a reference to its enclosing
transaction, enabling us to avoid calls to
TransactionFromContext. This may also enable
deferred transaction sampling in the future.

Transactions, spans, and errors are now all
sent to the tracer goroutine through a single
"chan tracerEvent" channel.

This change incurs a minor (~10%/~50 bytes)
increase in the number of bytes allocated
per transaction. There is no change in number
of allocs, and no significant impact on time
per operation.
@axw axw merged commit a631fe0 into elastic:master Mar 19, 2019
@axw axw deleted the start-after-ended branch March 19, 2019 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants