Sha256: f5be4077524b64258e61bb2353a74353457578eef53ad929894c5b5630cbae0f

Contents?: true

Size: 902 Bytes

Versions: 7

Compression:

Stored size: 902 Bytes

Contents

# frozen_string_literal: true

require "forwardable"
require "libhoney"
require "honeycomb/beeline/version"
require "honeycomb/client"
require "honeycomb/trace"

# main module
module Honeycomb
  INTEGRATIONS = %i[
    active_support
    faraday
    rack
    rails
    rake
    sequel
    sinatra
  ].freeze

  class << self
    extend Forwardable
    attr_reader :client

    def_delegators :@client, :start_span, :add_field, :add_field_to_trace

    def configure
      Configuration.new.tap do |config|
        yield config
        @client = Honeycomb::Client.new(configuration: config)
      end

      @client
    end

    def load_integrations
      INTEGRATIONS.each do |integration|
        begin
          require "honeycomb/integrations/#{integration}"
        rescue LoadError
        end
      end
    end
  end
end

Honeycomb.load_integrations unless ENV["HONEYCOMB_DISABLE_AUTOCONFIGURE"]

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
honeycomb-beeline-1.0.1 lib/honeycomb-beeline.rb
honeycomb-beeline-1.0.0 lib/honeycomb-beeline.rb
honeycomb-beeline-1.0.0.pre.beta4 lib/honeycomb-beeline.rb
honeycomb-beeline-1.0.0.pre.beta3 lib/honeycomb-beeline.rb
honeycomb-beeline-1.0.0.pre.beta2 lib/honeycomb-beeline.rb
honeycomb-beeline-1.0.0.pre.beta1 lib/honeycomb-beeline.rb
honeycomb-beeline-1.0.0.pre.beta lib/honeycomb-beeline.rb