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: introduce StartTransactionOptions #165

Merged
merged 1 commit into from
Aug 3, 2018

Conversation

axw
Copy link
Member

@axw axw commented Aug 2, 2018

Introduce Tracer.StartTransactionOptions, a variant
of Tracer.StartTransaction which accepts a third
parameter of type TransactionOptions. This replaces
the TransactionOption functional options; StartTransaction
no longer accepts variadic arguments.

The purpose of this is to avoid allocations due to
closures in hot code paths, such as starting transactions
in http middleware, where setting trace context will
be commonplace.

@axw axw force-pushed the start-transaction-options branch from 30a7308 to 440485b Compare August 2, 2018 10:27
@codecov-io
Copy link

codecov-io commented Aug 2, 2018

Codecov Report

Merging #165 into master will decrease coverage by 2.81%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #165      +/-   ##
==========================================
- Coverage   76.95%   74.13%   -2.82%     
==========================================
  Files          72       81       +9     
  Lines        4148     4934     +786     
==========================================
+ Hits         3192     3658     +466     
- Misses        730     1097     +367     
+ Partials      226      179      -47
Impacted Files Coverage Δ
transaction.go 93.58% <100%> (+12.33%) ⬆️
module/apmhttp/handler.go 72.5% <100%> (+4.16%) ⬆️
internal/apmdebug/debug.go 20% <0%> (ø)
internal/fastjson/marshaler.go 56.06% <0%> (ø)
internal/pretty/formatter.go 0% <0%> (ø)
internal/radix/radix.go 39% <0%> (ø)
internal/krtext/indent.go 0% <0%> (ø)
internal/fastjson/writer.go 66.23% <0%> (ø)
internal/pretty/zero.go 0% <0%> (ø)
internal/pretty/pretty.go 0% <0%> (ø)
... and 21 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 c0fbed3...5fba2ff. Read the comment docs.

Introduce Tracer.StartTransactionOptions, a variant
of Tracer.StartTransaction which accepts a third
parameter of type TransactionOptions. This replaces
the TransactionOption functional options; StartTransaction
no longer accepts variadic arguments.

The purpose of this is to avoid allocations due to
closures in hot code paths, such as starting transactions
in http middleware, where setting trace context will
be commonplace.
@axw axw force-pushed the start-transaction-options branch from 15af235 to 5fba2ff Compare August 2, 2018 12:45
@axw axw merged commit 8451555 into elastic:master Aug 3, 2018
@axw axw deleted the start-transaction-options branch August 3, 2018 02:01
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.

2 participants