Configuring guardrails

Configure guardrails by specifying a policy in the NOI Policy Service.

Procedure

  1. Connect to the NOI Policy Service.
  2. In the Request body section, specify the policy to define the guardrail.
  3. Click Execute.

Example

The following JSON provides the policy logic for the guardrail defined in About guardrails.
  • In line 25 the policy looks for incoming alerts where the event.resource.location field is set.
  • In lines 28 to 31, the value of event.resource.location is appended to the value of the correlation key, thereby partitioning the event group based on location.
Note: The same policy code can be used to partition scope-based groups and temporal groups.
Policy code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
[
  {
    "metadata": {
      "labels": {
        "ibm.com/is-default": "false"
     },
      "name": "Basic Guardrails policy",
      "description": "Prepends the correlation key with a user set value to constrict correlation globally",
      "createdBy": {
        "id": "system",
        "type": "system"
      },
    },
    "state": "enabled",
    "executionPriority": 50,
    "spec": {
      "trigger": {
        "entityId": "event",
        "triggerId": "aiops.ibm.com/trigger/event-post-insert"
      },
      "actions": [
        {
          "actionId": "aiops.ibm.com/action/internal/conditional",
          "arguments": {
            "condition": "not {{ isEmpty event.resource.location }}",
            "then": [
              {
                "actionId": "com.ibm.hdm.noi.actions.impl.EnrichPrependCorrelationKey",
                "arguments": {
                  "value": {
                    "$template": "{{event.resource.location}}-"
                  },
                  "event": {
                    "$variable": "event"
                  }
                }
              }
            ]
          }
        }
      ]
    },
  }
]