From c015bebb96d9b2344e125e0e0b47356d8f0eef83 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Thu, 20 Jun 2024 15:44:59 -0500 Subject: [PATCH] squash: Add docs PR feedback --- .../opentelemetry/instrumentation/sinatra.rb | 2 +- .../sinatra/instrumentation.rb | 26 +++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra.rb b/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra.rb index 5b6147252..c6bf01670 100644 --- a/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra.rb +++ b/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra.rb @@ -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 diff --git a/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra/instrumentation.rb b/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra/instrumentation.rb index 5bdb72eb3..251ce2e79 100644 --- a/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra/instrumentation.rb +++ b/instrumentation/sinatra/lib/opentelemetry/instrumentation/sinatra/instrumentation.rb @@ -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]