-
Notifications
You must be signed in to change notification settings - Fork 226
feat: make the install of rack instrumentation by grape instrumentation optional #1043
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
feat: make the install of rack instrumentation by grape instrumentation optional #1043
Conversation
In some circumstances we may want to defer the installation of the rack instrumentation that is orchestrated during the grape instrumentation installation. For example, we may want to customise the installation of the rack instrumentation or we can rely on the installation being orchestrated by another framework's instrumentation (such as when Grape is mounted with Rails). This change allows for Grape to skip the installation of the Rack instrumentation so that it can manually installed at a later time.
| # # Configuration keys and options | ||
| # ## `:ignored_events` | ||
| # | ||
| # Default is `[]`. Specifies which ActiveSupport::Notifications events published by Grape to ignore. | ||
| # Ignored events will not be published as Span events. | ||
| option :ignored_events, default: [], validate: :array | ||
| # ## `:install_rack` | ||
| # | ||
| # Default is `true`. Specifies whether or not to install the Rack instrumentation as part of installing the Grape instrumentation. | ||
| # This is useful in cases where you have multiple Rack applications but want to manually specify where to insert the tracing middleware. | ||
| option :install_rack, default: true, validate: :boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this documentation!
Though this is helpful when reading the code, this won't appear in the RubyDocs. Would you mind moving it above the class Instrumentation line?
Here's an example for what we're doing for Sidekiq:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the new change work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

In some circumstances we may want to defer the installation of the rack instrumentation that is orchestrated during the grape instrumentation installation. For example, we may want to customise the installation of the rack instrumentation or we can rely on the installation being orchestrated by another framework's instrumentation (such as when Grape is mounted with Rails).
This change allows for Grape to skip the installation of the Rack instrumentation so that it can manually installed at a later time.