Module: Datadog::Tracing::Contrib::Sinatra::Patcher
- Includes:
- Patcher
- Defined in:
- lib/datadog/tracing/contrib/sinatra/patcher.rb
Overview
Patcher enables patching of ‘sinatra’ module.
Class Method Summary collapse
- .patch ⇒ Object
- .patch_default_middlewares ⇒ Object
- .register_tracer ⇒ Object
- .setup_tracer ⇒ Object
- .target_version ⇒ Object
Methods included from Patcher
Class Method Details
.patch ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/datadog/tracing/contrib/sinatra/patcher.rb', line 51 def patch require_relative 'tracer' register_tracer patch_default_middlewares setup_tracer end |
.patch_default_middlewares ⇒ Object
68 69 70 |
# File 'lib/datadog/tracing/contrib/sinatra/patcher.rb', line 68 def patch_default_middlewares ::Sinatra::Base.singleton_class.prepend(DefaultMiddlewarePatch) end |
.register_tracer ⇒ Object
59 60 61 62 |
# File 'lib/datadog/tracing/contrib/sinatra/patcher.rb', line 59 def register_tracer ::Sinatra::Base.register(Contrib::Sinatra::Tracer) ::Sinatra::Base.prepend(Sinatra::Tracer::Base) end |
.setup_tracer ⇒ Object
64 65 66 |
# File 'lib/datadog/tracing/contrib/sinatra/patcher.rb', line 64 def setup_tracer ::Sinatra::Base.singleton_class.prepend(TracerSetupPatch) end |
.target_version ⇒ Object
47 48 49 |
# File 'lib/datadog/tracing/contrib/sinatra/patcher.rb', line 47 def target_version Integration.version end |