Skip to content

Commit

Permalink
squash: Add docs PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
arielvalentin committed Jun 20, 2024
1 parent 710bfac commit c015beb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

module OpenTelemetry
module Instrumentation
# Contains the OpenTelemetry instrumentation for the Sinatra gem
# (see OpenTelemetry::Instrumentation::Sinatra::Instrumentation)
module Sinatra
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,30 @@
module OpenTelemetry
module Instrumentation
module Sinatra
# The Instrumentation class contains logic to detect and install the Sinatra
# instrumentation
# The {OpenTelemetry::Instrumentation::Sinatra::Instrumentation} class contains logic to detect and install the Sinatra instrumentation
#
# Installation and configuration of this instrumentation is done within the
# {https://www.rubydoc.info/gems/opentelemetry-sdk/OpenTelemetry/SDK#configure-instance_method OpenTelemetry::SDK#configure}
# block, calling {https://www.rubydoc.info/gems/opentelemetry-sdk/OpenTelemetry%2FSDK%2FConfigurator:use use()}
# or {https://www.rubydoc.info/gems/opentelemetry-sdk/OpenTelemetry%2FSDK%2FConfigurator:use_all use_all()}.
#
# ## Configuration keys and options
#
# ### `:install_rack`
#
# Default is `true`. Specifies whether or not to install the Rack instrumentation as part of installing the Sinatra instrumentation.
# This is useful in cases where you have multiple Rack applications but want to manually specify where to instert the tracing middleware.
#
# @example Manually install Rack instrumentation.
# OpenTelemetry::SDK.configure do |c|
# c.use_all({
# 'OpenTelemetry::Instrumentation::Rack' => { },
# 'OpenTelemetry::Instrumentation::Sinatra' => {
# install_rack: false
# },
# })
# end
#
class Instrumentation < OpenTelemetry::Instrumentation::Base
install do |config|
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.install({}) if config[:install_rack]
Expand Down

0 comments on commit c015beb

Please sign in to comment.