Sha256: d1ae831bb7ec3706ad4cb3d27ebba7cdf68c95e003ada4ce23acacde806ca392

Contents?: true

Size: 864 Bytes

Versions: 406

Compression:

Stored size: 864 Bytes

Contents

# frozen_string_literal: true

module Appsignal
  class EventFormatter
    # @api private
    module ElasticSearch
      class SearchFormatter
        def format(payload)
          [
            "#{payload[:name]}: #{payload[:klass]}",
            sanitized_search(payload[:search]).inspect
          ]
        end

        def sanitized_search(search)
          return unless search.is_a?(Hash)

          {}.tap do |hsh|
            search.each do |key, val|
              hsh[key] =
                if [:index, :type].include?(key)
                  val
                else
                  Appsignal::Utils::QueryParamsSanitizer.sanitize(val)
                end
            end
          end
        end
      end
    end
  end
end

Appsignal::EventFormatter.register(
  "search.elasticsearch",
  Appsignal::EventFormatter::ElasticSearch::SearchFormatter
)

Version data entries

406 entries across 406 versions & 1 rubygems

Version Path
appsignal-2.9.8-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.8 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.7-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.7 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.6-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.6 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.5 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.5-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.4 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.4-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.3 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.3-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.2 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.2-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.2.alpha.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.2.alpha.1-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.1-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.0-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.9.0 lib/appsignal/event_formatter/elastic_search/search_formatter.rb