class NewRelic::Agent::Transaction::MessageBrokerSegment
Constants
- ACTIONS
- CONSUME
- DESTINATION_TYPES
- EXCHANGE
- METRIC_PREFIX
- NAMED
- PRODUCE
- PURGE
- QUEUE
- STREAM
- TEMP
- TOPIC
- TYPES
- UNKNOWN
Attributes
Public Class Methods
Source
# File lib/new_relic/agent/transaction/message_broker_segment.rb, line 57 def initialize(action:, library:, destination_type:, destination_name:, headers: nil, parameters: nil, start_time: nil) @action = action @library = library @destination_type = destination_type @destination_name = destination_name @headers = headers super(nil, nil, start_time) params.merge!(parameters) if parameters end
Calls superclass method
Public Instance Methods
Source
# File lib/new_relic/agent/transaction/message_broker_segment.rb, line 74 def name return @name if @name @name = METRIC_PREFIX + library @name << NewRelic::SLASH << TYPES[destination_type] << NewRelic::SLASH << ACTIONS[action] << NewRelic::SLASH if destination_type == :temporary_queue || destination_type == :temporary_topic @name << TEMP else @name << NAMED << destination_name.to_s end @name end
Source
# File lib/new_relic/agent/transaction/message_broker_segment.rb, line 89 def transaction_assigned if headers && transaction && action == :produce && record_metrics? transaction.distributed_tracer.insert_distributed_trace_header(headers) transaction.distributed_tracer.insert_cat_headers(headers) transaction.distributed_tracer.log_request_headers(headers) end rescue => e NewRelic::Agent.logger.error('Error during message header processing', e) end