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

Introduce "recording" config #737

Merged
merged 1 commit into from Apr 1, 2020
Merged

Introduce "recording" config #737

merged 1 commit into from Apr 1, 2020

Conversation

axw
Copy link
Member

@axw axw commented Mar 26, 2020

We introduce the ELASTIC_APM_RECORDING configuration.
This is a boolean configuration that defaults to true,
controlling whether events are recorded and sent. When
recording is true there should be no change; when false:

  • Transactions will always be recorded as "unsampled",
    and will be silently discarded when ended, without
    affecting tracer statistics
  • Spans will all be dropped by virtue of transactions
    all being unsampled
  • Captured errors will not have details filled in, and
    will be silently discarded when "sent" without affecting
    tracer statistics
  • Breakdown metrics will not be updated
  • Metrics gathering will be disabled

Recording can be updated via central config and by using
the new Tracer.SetRecording method.

We also introduce a new Tracer.Recording method which
reports whether events are being recorded. If the tracer
is inactive (Tracer.Active returns false), then
Tracer.Recording will also return false. This new method
can be used by instrumentation to avoid expensive
instrumentation paths when recording is disabled. We have
updated all provided instrumentation modules to use the
new Tracer.Recording method instead of Tracer.Active.

@axw
Copy link
Member Author

axw commented Mar 26, 2020

@bmorelli25 could you please take a gander at the docs addition? https://github.com/elastic/apm-agent-go/pull/737/files#diff-01c1a79a5a1e1b67003a1885365f2cf5

@axw axw force-pushed the recording branch 2 times, most recently from 0ec0568 to 97b51cd Compare March 26, 2020 08:06
@codecov-io
Copy link

codecov-io commented Mar 26, 2020

Codecov Report

Merging #737 into master will increase coverage by 0.09%.
The diff coverage is 82.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #737      +/-   ##
==========================================
+ Coverage   84.59%   84.69%   +0.09%     
==========================================
  Files         127      127              
  Lines        8271     8330      +59     
==========================================
+ Hits         6997     7055      +58     
  Misses        891      891              
- Partials      383      384       +1     
Impacted Files Coverage Δ
module/apmecho/middleware.go 88.77% <0.00%> (ø)
module/apmechov4/middleware.go 88.77% <0.00%> (ø)
module/apmgin/middleware.go 86.84% <0.00%> (ø)
module/apmhttprouter/handler.go 76.19% <0.00%> (ø)
module/apmrestful/filter.go 90.00% <0.00%> (ø)
profiling.go 71.87% <0.00%> (-3.54%) ⬇️
module/apmzap/core.go 64.10% <50.00%> (ø)
config.go 78.12% <66.66%> (+1.23%) ⬆️
tracer.go 88.85% <84.21%> (+0.86%) ⬆️
error.go 95.09% <100.00%> (+0.13%) ⬆️
... and 7 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 30724e0...3f07e58. Read the comment docs.

@axw
Copy link
Member Author

axw commented Mar 26, 2020

Leaving this open until elastic/kibana#61179 is done, so I can test e2e

We introduce the ELASTIC_APM_RECORDING configuration.
This is a boolean configuration that defaults to true,
controlling whether events are recorded and sent. When
recording is true there should be no change; when false:

 - Transactions will always be recorded as "unsampled",
   and will be silently discarded when ended, without
   affecting tracer statistics
 - Spans will all be dropped by virtue of transactions
   all being unsampled
 - Captured errors will not have details filled in, and
   will be silently discarded when "sent" without affecting
   tracer statistics
 - Breakdown metrics will not be updated
 - Metrics gathering will be disabled

Recording can be updated via central config and by using
the new Tracer.SetRecording method.

We also introduce a new Tracer.Recording method which
reports whether events are being recorded. If the tracer
is inactive (Tracer.Active returns false), then
Tracer.Recording will also return false. This new method
can be used by instrumentation to avoid expensive
instrumentation paths when recording is disabled. We have
updated all provided instrumentation modules to use the
new Tracer.Recording method instead of Tracer.Active.
@axw axw merged commit 45f723b into elastic:master Apr 1, 2020
@axw axw deleted the recording branch April 1, 2020 09:29
@axw axw mentioned this pull request Nov 18, 2020
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

3 participants