Module: NewRelic::Agent::OpenTelemetry::MessagingPatch
- Defined in:
- lib/new_relic/agent/opentelemetry/messaging_patch.rb
Constant Summary collapse
- PRODUCE =
A producer span with a remote parent MUST start a new transaction. Naming for that case is handled by MessagingPatch since NR’s transaction_name only knows about :consume
'Produce/'
Instance Method Summary collapse
Instance Method Details
#transaction_name(library, destination_type, destination_name, action = nil) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/new_relic/agent/opentelemetry/messaging_patch.rb', line 14 def transaction_name(library, destination_type, destination_name, action = nil) return super unless action == :produce name = Transaction::MESSAGE_PREFIX + library name << NewRelic::SLASH name << Transaction::MessageBrokerSegment::TYPES[destination_type] name << NewRelic::SLASH name << PRODUCE case destination_type when :queue, :topic, :exchange name << Transaction::MessageBrokerSegment::NAMED name << destination_name.to_s when :temporary_queue, :temporary_topic name << Transaction::MessageBrokerSegment::TEMP else # handles :stream or :unknown name << Transaction::MessageBrokerSegment::NAMED name << destination_name.to_s end name end |