opentelemetry-ruby-contrib icon indicating copy to clipboard operation
opentelemetry-ruby-contrib copied to clipboard

ActionPack - Add source code attributes, change enable_recognize_route default from false to true

Open richardmcmillen opened this issue 3 years ago • 0 comments

Motivation behind this PR is:

  • To ensure there are attribute(s) for the Controller and Action called when using the :rails_route span naming method.
  • Spark conversation around the recognize route option, what the default should be, or if it should be replaced/deprecated.

I think the enable_recognize_route option can be confusing:

  1. The default span naming for ActionPack is :rails_route..
  2. :rails_route naming uses recognize route method.
  3. Setting :enable_recognize_route to false, doesn't stop the method being called.

From what I can gather from https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/123 the enable_recognize_route option was to allow users to opt-in to this possibly expensive method call. However, the default options now use this method.

If the maintainers believe that opting out of this method call is important how should this be configured?

  1. Keep :enable_recognize_route but if it is false then also force the span name to be Controller#action? So that truly does disabled this method.
  2. Remove :enable_recognize_route and replace it with :enable_http_route, to more accurately describe what the option does, enables or disabled the http.route attribute? Document the use of recognize route better and how to disable it.

Resolves #159

richardmcmillen avatar Oct 30 '22 05:10 richardmcmillen