opentelemetry-ruby-contrib
opentelemetry-ruby-contrib copied to clipboard
ActionPack - Add source code attributes, change enable_recognize_route default from false to true
Motivation behind this PR is:
- To ensure there are attribute(s) for the Controller and Action called when using the
:rails_routespan 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:
- The default span naming for ActionPack is
:rails_route.. :rails_routenaming uses recognize route method.- Setting
:enable_recognize_routetofalse, 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?
- Keep
:enable_recognize_routebut if it isfalsethen also force the span name to beController#action? So that truly does disabled this method. - Remove
:enable_recognize_routeand replace it with:enable_http_route, to more accurately describe what the option does, enables or disabled thehttp.routeattribute? Document the use of recognize route better and how to disable it.
Resolves #159