Reducing error quota usage

If your applications are sending more errors than your plan allows, this can result in error loss and reduced debugging effectiveness. There are several options to reduce your error quota usage.

Setting a rate limit

All monthly quota plans support configuring a per minute rate limit. This value controls how many errors will be accepted each minute for your account. Any account admin can configure the rate limit per minute from the account settings.

Ignore noisy errors

Once you have identified a noisy error you can configure your notifier to avoid reporting it to Airbrake. Please visit your notifier’s GitHub repo if you don’t see your language in the examples below.

Ignore errors in Ruby

Airbrake.add_filter do |notice|
  notice.ignore! if notice.stash[:exception].is_a?(NoisyException)
end

Ignore errors in Javascript

airbrake.addFilter(function(notice) {
  if notice.errors[0].type === "NoisyException" {
    return null;
  }
  return notice;
});

Ignore errors in Go

airbrake.AddFilter(func(notice *gobrake.Notice) *gobrake.Notice {
  if notice.Errors[0]Type == "NoisyException" {
    return nil
  }
  return notice
})

Ignore errors in PHP

$notifier->addFilter(function ($notice) {
  if ($notice['errors'][0]['type'] == 'NoisyException') {
    return null;
  }
  return $notice;
});

Ignore errors in .NET

airbrake.AddFilter(notice =>
{
  var exception = notice.Exception as HttpException;
  if (exception != null && exception.GetType() == NoisyException)
      return null;

  return notice;
});

Accept only a portion of noisy errors

Once you have identified the noisy errors that are depleting your quota, this config code will accept only a sample of the occurrences. This example is for our ruby notifier but you can use this strategy for any notifier that supports the add_filter configuration option.

noisy_errors = [Resque::TermException, NoMethodError, Redis::CannotConnectError]

noisy_errors.each do |noisy_error|
  Airbrake.add_filter do |notice|
    if noisy_errors.include?(notice.stash[:exception])
      # Ignore this error 90% of the time
      random_number = Random.rand(1..10)
      notice.ignore! if random_number != 1
    end
  end
end