Skip to content

Commit

Permalink
fix: elastalert send 200 even for soft blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
armiiller committed Oct 28, 2022
1 parent fe963a5 commit 4548a54
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions app/models/pager_tree/integrations/elast_alert/v3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,29 @@ def adapter_process_create
)
end

# elastalert will raise an error for any 4xx or 5xx response and then retry for a default of 2 days
# https://github.com/Yelp/elastalert/blob/master/elastalert/alerts.py#L1496
# we don't want to get spammy with retries, so we'll just return a 200
def adapter_response_rate_limit
adapter_controller&.head(:ok)
end

def adapter_response_disabled
adapter_controller&.head(:ok)
end

def adapter_response_inactive_subscription
adapter_controller&.head(:ok)
end

def adapter_response_upgrade
adapter_controller&.head(:ok)
end

def adapter_response_blocked
adapter_controller&.head(:ok)
end

private

# See https://github.com/Yelp/elastalert/pull/2001 for details
Expand Down

0 comments on commit 4548a54

Please sign in to comment.