Sha256: d890749dbe0be6bd772798ccfe2ae4ea7649dbb547ca872f66629a6f37f1cda4

Contents?: true

Size: 893 Bytes

Versions: 11

Compression:

Stored size: 893 Bytes

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

module NewRelic
  module Agent
    module DistributedTraceTransportType
      extend self

      ALLOWABLE_TRANSPORT_TYPES = [
        NewRelic::UNKNOWN,
        NewRelic::HTTP,
        NewRelic::HTTPS,
        "Kafka",
        "JMS",
        "IronMQ",
        "AMQP",
        "Queue",
        "Other",
      ].freeze

      URL_SCHEMES = {
        'http'  => NewRelic::HTTP,
        'https' => NewRelic::HTTPS,
      }.freeze

      RACK_URL_SCHEME = 'rack.url_scheme'

      def from value
        ALLOWABLE_TRANSPORT_TYPES.include?(value) ? value : NewRelic::UNKNOWN
      end

      def for_rack_request request
        URL_SCHEMES[request[RACK_URL_SCHEME]]
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
newrelic_rpm-8.2.0 lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb
newrelic_rpm-8.1.0 lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb
newrelic_rpm-8.0.0 lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb
newrelic_rpm-7.2.0 lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb
newrelic_rpm-7.1.0 lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb
newrelic_rpm-7.0.0 lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb
newrelic_rpm-6.15.0 lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb
newrelic_rpm-6.14.0 lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb
newrelic_rpm-6.13.1 lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb
newrelic_rpm-6.13.0 lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb
newrelic_rpm-6.12.0.367 lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb