process_body

in lib/elastic/transport/opentelemetry.rb [72:81]


      def process_body(body, endpoint)
        return if @body_strategy == DEFAULT_BODY_STRATEGY || !search_endpoint?(endpoint)

        if @body_strategy == 'sanitize'
          Sanitizer.sanitize(body, @sanitize_keys).to_json
        elsif @body_strategy == 'raw'
          body.is_a?(String) ? body : body.to_json
        end
      end