Module: NewRelic::Agent::DistributedTraceTransportType

Extended by:
DistributedTraceTransportType
Included in:
DistributedTraceTransportType
Defined in:
lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb

Constant Summary collapse

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'

Instance Method Summary collapse

Instance Method Details

#for_rack_request(request) ⇒ Object



33
34
35
# File 'lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb', line 33

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

#from(value) ⇒ Object



29
30
31
# File 'lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb', line 29

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