Integrate alerts with FlashDuty

更新时间:
复制 MD 格式

This topic describes how to use a webhook to sync Simple Log Service (SLS) alert events to FlashDuty for automated alert processing.

Background information

FlashDuty is an enterprise-level, unified incident response platform that receives alert events from various sources. It provides unified management, collaboration, analysis, and automated processing for these events to help improve incident response efficiency and reduce losses from failures.

drawing.png

Step 1: Set up FlashDuty

  1. Log on to the FlashDuty console.

  2. In the navigation pane, click Collaboration Space.

  3. In the collaboration space list, click the target collaboration space.

    You can also create a new collaboration space to integrate SLS alerts.

  4. On the Alert Integration tab, click Add an Integration.

  5. In the Add Integration panel, click Alibaba Cloud SLS, and then click Save.

  6. In the Dedicated Integration area, click the target integration.

  7. In the Dedicated Integration Details panel, copy the API URL.

    Use this URL when you create the webhook in SLS.

Step 2: Set up Simple Log Service

Configure a webhook

  1. Log on to the Simple Log Service console.

  2. Go to the Webhook Integration tab.

    1. In the Projects section, click a project.

    2. In the left-side navigation pane, click Alerts.

    3. On the Alert Center page, choose Notification Objects > Webhook Integration.

  3. Create a webhook.

    1. On the Webhook Integration tab, click Create.

    2. In the Create Webhook dialog box, configure the following parameters and click Confirm.

      Parameter

      Description

      Identifier

      A unique identifier for the webhook. It cannot be the same as another identifier.

      Name

      The name of the webhook.

      Type

      The webhook type. Select General Webhook.

      Request Method

      The request method to call the webhook. Select POST.

      Request URL

      The webhook URL. Enter the URL that you generated in FlashDuty.

Configure a content template

  1. On the Alert Center page, choose Notification Policy > Content Template.

  2. On the Content Template tab, click Add.

  3. In the Add Content Template dialog box, select WebHook-Custom, configure the following parameters, and then click Confirm.

    Parameter

    Description

    ID

    The content template ID. Set it to sls.flashduty.

    Name

    The content template name. Set it to FlashDuty.

    Sending Method

    Select Send One by One.

    Content to Send

    Set it to {{ alert | to_json}}.

Configure an action policy

  1. On the Alert Center page, choose Notification Policy > Action Policy.

  2. On the Action Policy tab, click Create.

  3. In the Add Action Policy dialog box, configure the following parameters.

    1. Set the ID and name.

    2. Select the primary action list.

    3. Click the image..png icon to add an action group.

    4. Set up the action group.

      Parameter

      Description

      Channel

      Select General Webhook.

      Select Webhook

      Select the webhook that you created.

      Content Template

      Select the content template that you created.

      Sending Period

      Select Any.

    5. Click the image..png icon to complete the configuration.

    6. Click Confirm.

Configure an alert monitoring rule

  1. On the Alert Center page, click Alert Rules.

  2. On the Alert Rules tab, find the target alert monitoring rule and click Edit.

    You can also click Create Alert. This topic uses an existing alert monitoring rule as an example.

  3. In the Alert Monitoring Rule panel, make the following changes.

    1. Set Alert Policy to Normal Alert.

    2. Set Action Policy to the action policy that you created in the previous step.

    3. Click OK.

Step 3: Verify the integration

When an SLS alert is triggered, you can view and process it in FlashDuty. FlashDuty can merge similar events into a single alert. It can also extract information from the SLS alert and display it in the Labels area.