Sha256: b90c80b044a69a126c517e84464b42e0b1622213264662c7372948e6f9521d93
Contents?: true
Size: 1.02 KB
Versions: 14
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true module Mnemosyne module Probes module Msgr module Client NAME = 'external.publish.msgr'.freeze class Probe < ::Mnemosyne::Probe def setup ::Msgr::Client.send :prepend, Instrumentation end end module Instrumentation def publish(payload, **options) if (trace = ::Mnemosyne::Instrumenter.current_trace) meta = {} span = ::Mnemosyne::Span.new(NAME, meta: meta) span.start! options[:headers] ||= {} options[:headers][:'mnemosyne.transaction'] = trace.transaction options[:headers][:'mnemosyne.origin'] = span.uuid begin super ensure span.finish! trace << span end else super end end end end end register 'Msgr::Client', 'msgr/client', Msgr::Client::Probe.new end end
Version data entries
14 entries across 14 versions & 1 rubygems