Skip to content

Support accepting epoch millis for alert manager ended at

What does this MR do and why?

This PoC MR allows numeric JSON fields (unix epoch millis) to be mapped as ended at timestamp for the alert ingestion feature. This would make it possible to integrate with JIRA.

Related thread: #348626 (comment 1765568983)

How to set up and validate locally

  1. Ensure that your GDK is on premium or on ultimate license.
  2. Go to a project, Settings > Monitor
  3. Open the Alerts accordion and click Add integration
  4. Select HTTP endpoint for the integration type
  5. Give it a name and enable it
  6. Set up the payload mapping using this JSON example:
{
  "title": "Incident title",
  "description": "Short description of the incident",
  "start_time": "2019-09-12T06:00:55Z",
  "service": "service affected",
  "monitoring_tool": "value",
  "hosts": "value",
  "severity": "high",
  "fingerprint": "d19381d4e8ebca87b55cda6e8eee7385",
  "end_time": 1712554340977,
  "foo": {
    "bar": {
      "baz": 42
    }
  }
}
  1. When assigning the fields, ensure that end_time and fingerprint sections are correctly mapped to the fields with the same name
  2. Click save integration
  3. Click edit integration and go to the Send test alert tab
  4. Paste the following JSON document:
{
  "title": "Incident title",
  "description": "Short description of the incident",
  "start_time": "2019-09-12T06:00:55Z",
  "service": "service affected",
  "monitoring_tool": "value",
  "hosts": "value",
  "severity": "high",
  "fingerprint": "d19381d4e8ebca87b55cda6e8eee7385",
  "end_time": null,
  "foo": {
    "bar": {
      "baz": 42
    }
  }
}
  1. Click Send
  2. Open Monitor > Alert from the sidebar in a new tab and see if the alert showed up
  3. On the test tab, try to close the alert with the same payload where the end_date is present
{
  "title": "Incident title",
  "description": "Short description of the incident",
  "start_time": "2019-09-12T06:00:55Z",
  "service": "service affected",
  "monitoring_tool": "value",
  "hosts": "value",
  "severity": "high",
  "fingerprint": "d19381d4e8ebca87b55cda6e8eee7385",
  "end_time": 1712554340977,
  "foo": {
    "bar": {
      "baz": 42
    }
  }
}
13. By refreshing the alert list, the previously created alert should be resolved
Edited by Adam Hegyi

Merge request reports