Skip to content

Automatically add Incident timeline events when certain events occur

What does this MR do and why?

Implement to #345096 (closed)

Automatically add Incident timeline events when certain events occur. Displaying the timeline events on the page is still behind a feature flag.

Covers the following events:

  • Incident is created
  • Incident is reopened
  • Incident is resolved (by closing)
  • Incident/Alert status changed

Some implementation decisions

Since the feature is still behind a feature flag, I was bouncing between two solutions here. On one hand, we can check the feature flag before we create an automatic timeline event. In this case, we won't create any timeline events when the feature flag is disabled.

On the other hand, we can skip the feature flag checks here and create timeline events every time this event occurs. If the feature flag is disabled, we'll still keep creating timeline events but they won't be displayed on the page.

I think the first solution has a flaw. Let me demonstrate that on the example.

  1. The admin turns the feature flag on
  2. A user changes the status from triggered to acknowledged
  3. A timeline event is created "Status changed to Acknowledged"
  4. The admin turns the feature flags off
  5. The user changes the status from acknowledged back to triggered
  6. No timeline events is created due to the disabled feature flag
  7. The admin turn the feature flags back on
  8. A user changes the status from triggered to resolved
  9. A new timeline event is created "Status changed to Resolved"

At this point, the timeline doesn't reflect all its events. We're missing one in the middle because the feature flag was off. If we skip the feature flag check on creating, we're going to see the complete timeline.

Screenshots or screen recordings

Screenshot_2022-06-22_at_12.13.59

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Vitali Tatarintev

Merge request reports

Loading