Sha256: 0e13390d7b0288858b1ca07d0c741a97d58f77441651662edf7ded3fdb8b9217
Contents?: true
Size: 482 Bytes
Versions: 12
Compression:
Stored size: 482 Bytes
Contents
module PlainApm module Helpers def plain_apm_context(context = {}) PlainApm::Extensions::Context.context.merge!(context) end def plain_apm_instrument(name, context = {}, &block) sanitized_name = name.gsub(/\W/, "_").gsub(/(?!^)([A-Z])/) { |m| "_#{m}" }.squeeze("_").downcase return unless defined?(ActiveSupport::Notifications) ActiveSupport::Notifications.instrument("#{sanitized_name}.manual_plain_apm", **context, &block) end end end
Version data entries
12 entries across 12 versions & 1 rubygems