Skip to content

Best way to selectively prevent span recording? #640

Answered by fbogsany
treyhyde asked this question in Q&A
Discussion options

You must be logged in to vote
OpenTelemetry::SDK.configure do |c|
  c.use 'OpenTelemetry::Instrumentation::Rack', { untraced_endpoints: ['probes/ready'] }
end

or

OpenTelemetry::SDK.configure do |c|
  c.use_all { 'OpenTelemetry::Instrumentation::Rack' => { untraced_endpoints: ['probes/ready'] } }
end

Two things here:

  1. c.use or c.use_all should be used to set config options for instrumentation rather than setting it directly with OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.config - the latter will either not install the instrumentation correctly or will clobber its config.
  2. Config option names are symbols rather than strings.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@treyhyde
Comment options

Answer selected by treyhyde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants