lib/elastic_apm.rb
# Provide a filter to transform payloads before sending them off
#
# @param key [Symbol] Unique filter key
# @param callback [Object, Proc] A filter that responds to #call(payload)
# @yield [Hash] A filter. Used if provided. Otherwise using `callback`
# @return [Bool] true
Provide a filter to transform payloads before sending them off
Provide a filter to transform payloads before sending them off
def add_filter(key, callback = nil, &block)
      if callback.nil? && !block_given?
        raise ArgumentError, '#add_filter needs either `callback\' or a block'
      end
      agent&.add_filter(key, block || callback)
    end
def add_filter ( key , callback = nil , & block ) if callback . nil? && ! block_given? raise ArgumentError , '#add_filter needs either `callback\' or a block' end agent &. add_filter ( key , block || callback ) end
Provide a filter to transform payloads before sending them off
Provide a filter to transform payloads before sending them off
None
Bool
key
Unique filter key
Unique filter key
callback
A filter that responds to #call(payload)
A filter that responds to #call ( payload )
block
]
A filter. Used if provided. Otherwise using `callback`
A filter . Used if provided . Otherwise using ` callback `