Sha256: 3b1f7043c90300b7f698e83d024750c762b5142e76f23cc4e285ece93cb66010

Contents?: true

Size: 557 Bytes

Versions: 5

Compression:

Stored size: 557 Bytes

Contents

# frozen_string_literal: true

module ElasticAPM
  module Transport
    # @api private
    class UserAgent
      def initialize(config)
        @built = build(config)
      end

      def to_s
        @built
      end

      private

      def build(config)
        metadata = Metadata.new(config)

        [
          "elastic-apm-ruby/#{VERSION}",
          HTTP::Request::USER_AGENT,
          [
            metadata.service.runtime.name,
            metadata.service.runtime.version
          ].join('/')
        ].join(' ')
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
elastic-apm-3.6.0 lib/elastic_apm/transport/user_agent.rb
elastic-apm-3.5.0 lib/elastic_apm/transport/user_agent.rb
elastic-apm-3.4.0 lib/elastic_apm/transport/user_agent.rb
elastic-apm-3.3.0 lib/elastic_apm/transport/user_agent.rb
elastic-apm-3.2.0 lib/elastic_apm/transport/user_agent.rb