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

elasticapm: StartSpan always returns non-nil #92

Merged
merged 1 commit into from
May 18, 2018
Merged

Conversation

axw
Copy link
Member

@axw axw commented May 17, 2018

Transaction.StartSpan and elasticapm.StartSpan now
always return non-nil, even if the transaction is nil.
This simplifies callsites so they don't have to nil
checking of spans.

Transaction.StartSpan and elasticapm.StartSpan now
always return non-nil, even if the transaction is nil.
This simplifies callsites so they don't have to nil
checking of spans.
@codecov-io
Copy link

codecov-io commented May 17, 2018

Codecov Report

Merging #92 into master will increase coverage by <.01%.
The diff coverage is 89.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #92      +/-   ##
==========================================
+ Coverage   74.31%   74.32%   +<.01%     
==========================================
  Files          60       60              
  Lines        3134     3131       -3     
==========================================
- Hits         2329     2327       -2     
  Misses        620      620              
+ Partials      185      184       -1
Impacted Files Coverage Δ
module/apmsql/driver_go110.go 64% <100%> (-1.39%) ⬇️
module/apmsql/stmt.go 58.13% <100%> (-1.87%) ⬇️
module/apmsql/conn.go 55.43% <100%> (-1.86%) ⬇️
module/apmgrpc/client.go 86.66% <100%> (-0.84%) ⬇️
gocontext.go 53.84% <100%> (+7.69%) ⬆️
transaction.go 87.82% <84.84%> (-0.26%) ⬇️

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 b7c3b32...37f7da5. Read the comment docs.

@axw
Copy link
Member Author

axw commented May 17, 2018

Note that this is not all roses. With this, non-sampled transactions will now incur a bit more overhead due to the allocations. We could return a singleton for dropped spans, but then we could have multiple goroutines racing on updates to the span object. The overhead is kept to a minimum by using a sync.Pool, so I think this is a reasonable trade-off for this safer and neater API.

@axw axw merged commit cb5aab9 into elastic:master May 18, 2018
@axw axw deleted the span-api branch May 18, 2018 02:18
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.

3 participants