Sha256: e3d0b2f1af80d82347e49c8c1feb736182c109ff8c6aa7c86e050f6bf6234add

Contents?: true

Size: 574 Bytes

Versions: 3

Compression:

Stored size: 574 Bytes

Contents

# frozen_string_literal: true

# Copyright 2020 OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

require_relative 'extensions/tracer_extension'

module OpenTelemetry
  module Adapters
    module Sinatra
      # The Adapter class contains logic to detect and install the Sinatra
      # instrumentation adapter
      class Adapter < OpenTelemetry::Instrumentation::Adapter
        install do |_|
          ::Sinatra::Base.register Extensions::TracerExtension
        end

        present do
          defined?(::Sinatra)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opentelemetry-adapters-sinatra-0.4.1 lib/opentelemetry/adapters/sinatra/adapter.rb
opentelemetry-adapters-sinatra-0.4.0 lib/opentelemetry/adapters/sinatra/adapter.rb
opentelemetry-adapters-sinatra-0.3.0 lib/opentelemetry/adapters/sinatra/adapter.rb