Skip to content

Conversation

@chrisholmes
Copy link
Contributor

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.

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.
Comment on lines 29 to 39
# # 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
Copy link
Contributor

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:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, will do

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks great! Thank you!

Screenshot 2024-07-01 at 3 09 49 PM

@arielvalentin arielvalentin merged commit 7dd1c5d into open-telemetry:main Jul 2, 2024
This was referenced Jul 2, 2024
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.

4 participants