Skip to content

Ignore errors from healthcheck endpoints when reporting to BugSnag #217

@ajkiessl

Description

@ajkiessl

We want to prevent our healthcheck endpoints from reporting to BugSnag if they raise an error. Since these endpoints are often being triggered at a high frequency, if they report to BugSnag everytime, we will quickly exceed our BugSnag quotas. Ultimately, the healthcheck probe will be aware of the errors anyway, so BugSnag doesn't need notified. This was the solution we came up with for catalog:

Bugsnag.configure do |config|
  config.add_on_error(proc do |event|
    action = event.request&.dig(:railsAction)

    event.ignore! if action&.start_with?('ok_computer')
  end)
end

Note that this exact configuration might not work for this application. However, if all healthchecks are ran through OkComputer, then it should work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions