class ElasticAPM::ErrorBuilder

def add_stacktrace(error, kind, backtrace)

def add_stacktrace(error, kind, backtrace)
  return unless (stacktrace = Stacktrace.build(@config, backtrace, :error))
  case kind
  when :exception
    error.exception.stacktrace = stacktrace
  when :log
    error.log.stacktrace = stacktrace
  end
  error.culprit = stacktrace.frames.first.function
end