Sha256: 27fb67d1b0f2faec97fcfc905f5823deb00fe7b232525a56d4436da521bef385

Contents?: true

Size: 1.13 KB

Versions: 6

Compression:

Stored size: 1.13 KB

Contents

# If you use Errbit, you can pull exception reports in as Alerts.

# The first time we sync errs after booting, we'll catch up
# by pulling down changes from the last week.
$errbit_since_changes_since = 1.week.ago

Houston::Alerts.config.sync :changes, "err", every: "45s" do
  app_project_map = Hash[Project
    .where(error_tracker_name: "Errbit")
    .pluck("(props->>'errbit.appId')::integer", :id)]
  app_ids = app_project_map.keys

  Houston::Adapters::ErrorTracker::ErrbitAdapter.changed_problems(app_id: app_ids, since: $errbit_since_changes_since).map { |problem|
    key = "#{problem.id}-#{problem.opened_at.to_i}"
    { key: key,
      number: problem.err_ids.min,
      project_id: app_project_map[problem.app_id],
      summary: problem.message,
      environment_name: problem.environment,
      text: problem.where,
      opened_at: problem.opened_at,
      closed_at: problem.resolved_at,
      destroyed_at: problem.deleted_at,
      url: problem.url } }.tap do

    # From now on, we should expect to sync every 45 seconds,
    # so we'll pull down changes from a smaller window.
    $errbit_since_changes_since = 3.minutes.ago
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
houston-core-0.8.0.pre templates/new-instance/config/alerts/errs.rb
houston-core-0.7.0 templates/new-instance/config/alerts/errs.rb
houston-core-0.7.0.beta4 templates/new-instance/config/alerts/errs.rb
houston-core-0.7.0.beta3 templates/new-instance/config/alerts/errs.rb
houston-core-0.7.0.beta2 templates/new-instance/config/alerts/errs.rb
houston-core-0.7.0.beta templates/new-instance/config/alerts/errs.rb