Sha256: 2cbf7a7a94f2f3a3878cb74a61346044d08a11f32cd41314ebb4c0a8d2da036c

Contents?: true

Size: 777 Bytes

Versions: 30

Compression:

Stored size: 777 Bytes

Contents

module Appsignal
  class EventFormatter
    # @api private
    module ElasticSearch
      class SearchFormatter < Appsignal::EventFormatter
        register "search.elasticsearch"

        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

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
appsignal-2.5.1-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.5.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.5.1.beta.1-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.5.1.beta.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.5.0-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.5.0 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.5.0.beta.1-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.5.0.beta.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.5.0.alpha.1-java lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.5.0.alpha.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.4.3 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.4.2 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.4.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.4.0 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.4.0.alpha.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.3.7 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.3.6 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.3.6.beta.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.3.4 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.3.3 lib/appsignal/event_formatter/elastic_search/search_formatter.rb