def sanitized_environment
      env = environment
      return if env.empty?

      {}.tap do |out|
        Appsignal.config[:request_headers].each do |key|
          out[key] = env[key] if env[key]
        end
      end
    end
def sanitized_environment
      env = environment
      return if env.empty?

      {}.tap do |out|
        Appsignal.config[:request_headers].each do |key|
          out[key] = env[key] if env[key]
        end
      end
    end
Returns sanitized environment for a transaction.

 The environment of a transaction can contain a lot of information, not
 all of it useful for debugging.

 @return [nil] if no environment is present.
 @return [Hash<String, Object>]