class ElasticAPM::Filters::SecretsFilter
@api private
def call(payload)
def call(payload) strip_from payload[:transactions], :context, :request, :headers strip_from payload[:transactions], :context, :response, :headers strip_from payload[:errors], :context, :request, :headers strip_from payload[:errors], :context, :response, :headers payload end
def filter_key?(key)
def filter_key?(key) KEY_FILTERS.any? { |regex| key =~ regex } end
def filter_value?(value)
def filter_value?(value) VALUE_FILTERS.any? { |regex| value =~ regex } end
def initialize(config)
def initialize(config) @config = config end
def strip_from(events, *path)
def strip_from(events, *path) return unless events events.each do |event| next unless (headers = event.dig(*path)) headers.each do |k, v| if filter_key?(k) || filter_value?(v) headers[k] = FILTERED end end end end