Sha256: fce72f9ba2a50fe95a5ba9420cfaf204e7eec8162704419cb4b99c17373e5619
Contents?: true
Size: 1.43 KB
Versions: 33
Compression:
Stored size: 1.43 KB
Contents
# frozen_string_literal: true module Labkit module Tracing module Rails module ActiveSupport # ActiveSupport bridges action active support notifications to # the distributed tracing subsystem class Subscriber include Labkit::Tracing::TracingCommon CACHE_READ_TOPIC = "cache_read.active_support" CACHE_GENERATE_TOPIC = "cache_generate.active_support" CACHE_FETCH_HIT_TOPIC = "cache_fetch_hit.active_support" CACHE_WRITE_TOPIC = "cache_write.active_support" CACHE_DELETE_TOPIC = "cache_delete.active_support" # Instruments Rails ActiveSupport events for opentracing. # Returns a lambda, which, when called will unsubscribe from the notifications def self.instrument subscriptions = [ ::ActiveSupport::Notifications.subscribe(CACHE_READ_TOPIC, CacheReadInstrumenter.new), ::ActiveSupport::Notifications.subscribe(CACHE_GENERATE_TOPIC, CacheGenerateInstrumenter.new), ::ActiveSupport::Notifications.subscribe(CACHE_FETCH_HIT_TOPIC, CacheFetchHitInstrumenter.new), ::ActiveSupport::Notifications.subscribe(CACHE_WRITE_TOPIC, CacheWriteInstrumenter.new), ::ActiveSupport::Notifications.subscribe(CACHE_DELETE_TOPIC, CacheDeleteInstrumenter.new), ] create_unsubscriber subscriptions end end end end end end
Version data entries
33 entries across 33 versions & 1 rubygems