> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flashcat.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Dynatrace 告警事件

> 通过 webhook 的方式同步 Dynatrace 告警事件到 Flashduty On-call，实现告警事件自动化降噪处理。

<div className="hide">
  ## 在 Flashduty On-call

  ***

  您可通过以下2种方式，获取一个集成推送地址，任选其一即可。

  ### 使用专属集成

  当您不需要将告警事件路由到不同的协作空间，优先选择此方式，更简单。

  <AccordionGroup>
    <Accordion title="展开">
      1. 进入 Flashduty 控制台，选择 **协作空间**，进入某个空间的详情页面
      2. 选择 **集成数据** tab，点击 **添加一个集成**，进入添加集成页面
      3. 选择 **Dynatrace** 集成，点击 **保存**，生成卡片。
      4. 点击生成的卡片，可以查看到 **推送地址**，复制备用，完成。
    </Accordion>
  </AccordionGroup>

  ### 使用共享集成

  当您需要根据告警事件的 Payload 信息，将告警路由到不同的协作空间，优先选择此方式。

  <AccordionGroup>
    <Accordion title="展开">
      1. 进入 Flashduty 控制台，选择 **集成中心=>告警事件**，进入集成选择页面。
      2. 选择 **Dynatrace** 集成：
         * **集成名称**：为当前集成定义一个名称。
      3. 配置默认路由，并选择对应的协作空间（集成创建后可以前往 `路由` 进行更多路由规则的配置）。
      4. 点击 **保存** 后，复制当前页面的新生成的 **推送地址** 备用。
      5. 完成。
    </Accordion>
  </AccordionGroup>
</div>

## 在 Dynatrace

***

<div className="md-block">
  ## 一、Dynatrace 告警推送配置

  1. 登录您的 Dynatrace 控制台。
  2. 在左侧导航栏选择 `Apps`，在 `Manage` 区域找到 `Settings`。

  <img alt="drawing" width="600" src="https://download.flashcat.cloud/flashduty/doc/dyn-1.png" />

  3. 找到 `Integration`，选择 `Problem notifications`。

  <div style={{textAlign: "center"}}>
    <img alt="drawing" width="600" src="https://download.flashcat.cloud/flashduty/doc/dyn-2.png" />
  </div>

  4. 点击 `Add notifycation`。

  <img alt="drawing" width="600" src="https://download.flashcat.cloud/flashduty/doc/dyn-3.png" />

  5. 在 `Notification type` 处，选择 `Custom Integraion`。
  6. `Display name` 填写 `Flashduty`。
  7. `Webhook URL` 填写集成的推送地址（当前页面填写集成名称，保存后即可生成地址）。
  8. `Call webhook if problem is closed` 保持开启状态。

  <img alt="drawing" width="600" src="https://download.flashcat.cloud/flashduty/doc/dyn-4.png" />

  9. `Custom payload` 处，填写以下内容：

  ```
  {
      "State":"{State}",
      "PID":"{PID}",
      "ProblemTitle":"{ProblemTitle}",
      "ProblemImpact":"{ProblemImpact}",
      "ProblemDetails":"{ProblemDetailsText}",
      "ProblemURL":"{ProblemURL}",
      "ProblemSeverity":"{ProblemSeverity}",
      "ImpactedEntityNames":"{ImpactedEntityNames}",
      "Tags":"{Tags}"
  }

  ```

  <img alt="drawing" width="600" src="https://download.flashcat.cloud/flashduty/doc/dyn-5.png" />

  10. 点击 `Save changes` 保存即可 。
</div>

## 二、状态对照

<div className="md-block">
  | Dynatrace            | Flashduty | 状态 |
  | -------------------- | --------- | -- |
  | AVAILABILITY         | Critical  | 严重 |
  | ERROR                | Warning   | 警告 |
  | PERFORMANCE          | Info      | 提醒 |
  | RESOURCE\_CONTENTION | Info      | 提醒 |
  | CUSTOM\_ALERT        | Info      | 提醒 |
</div>
