oncall-engine/engine/apps/alerts/tasks
Joey Orlando 4d655dff60
modify check_escalation_finished_task task (#1266)
# What this PR does

This PR:
- modifies the `check_escalation_finished_task` celery task to:
  - do stricter escalation validation based on the alert group's
escalation snapshot (see the `audit_alert_group_escalation` method in
`engine/apps/alerts/tasks/check_escalation_finished.py` for the
validation logic)
- use a read-only database for querying alert-groups if one is
configured, otherwise use the "default" one
- ping a configurable heartbeat (new env var
`ALERT_GROUP_ESCALATION_AUDITOR_CELERY_TASK_HEARTBEAT_URL` added)
- increase the task frequency from every 10 to every 13 minutes (this
can be configured via an env variable)
  - adds public documentation on how to configure this auditor task
- modifies the local celery startup command to properly take into
consideration all celery related env vars (similar to the ones we use in
`engine/celery_with_exporter.sh`; this made it easier to enable `celery
beat` locally for testing)
- removes the following code:
- removes references to `AlertGroup.estimate_escalation_finish_time` and
marks the model field as deprecated using the [`django-deprecate-fields`
library](https://pypi.org/project/django-deprecate-fields/). This field
was only used for the previous version of this validation task
- `EscalationSnapshotMixin.calculate_eta_for_finish_escalation` was only
used to calculate the value for
`AlertGroup.estimate_escalation_finish_time`
  - `calculate_escalation_finish_time` celery task
  

## Which issue(s) this PR fixes

https://github.com/grafana/oncall-private/issues/1558

## Checklist

- [x] Tests updated
- [x] Documentation added
- [x] `CHANGELOG.md` updated
2023-03-17 10:14:08 +00:00
..
__init__.py modify check_escalation_finished_task task (#1266) 2023-03-17 10:14:08 +00:00
acknowledge_reminder.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
alert_group_web_title_cache.py Improve Jinja Template feedback and error handling (#884) 2022-11-28 09:46:51 -07:00
call_ack_url.py Lint 2022-08-02 15:26:17 -06:00
check_escalation_finished.py modify check_escalation_finished_task task (#1266) 2023-03-17 10:14:08 +00:00
compare_escalations.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
create_contact_points_for_datasource.py Refactor create/update contact points for Alerting integration (#872) 2023-01-25 09:42:42 +01:00
custom_button_result.py Handle JSONDecodeError for outgoing webhooks (#460) 2022-09-01 14:36:34 +01:00
delete_alert_group.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
distribute_alert.py Refactor maintenance (#1340) 2023-02-23 07:13:03 +00:00
escalate_alert_group.py Refactor maintenance (#1340) 2023-02-23 07:13:03 +00:00
invite_user_to_join_incident.py Refactor get_user_verbal_for_team_for_slack. (#809) 2023-03-07 10:09:37 +00:00
maintenance.py Insight logs (#348) 2022-08-24 12:04:44 +05:00
notify_all.py Fix the cause of retry of notify_all and notify_group tasks (#1376) 2023-02-23 09:28:13 +00:00
notify_group.py Fix the cause of retry of notify_all and notify_group tasks (#1376) 2023-02-23 09:28:13 +00:00
notify_ical_schedule_shift.py Matiasb/fix task refresh ical when empty value (#1401) 2023-02-24 21:16:09 +00:00
notify_user.py Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
resolve_alert_group_by_source_if_needed.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
resolve_by_last_step.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
send_alert_group_signal.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
send_update_log_report_signal.py Refactor maintenance (#1340) 2023-02-23 07:13:03 +00:00
send_update_postmortem_signal.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
send_update_resolution_note_signal.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
sync_grafana_alerting_contact_points.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
task_logger.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
unsilence.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
wipe.py World, meet OnCall! 2022-06-03 08:09:47 -06:00