flashduty-knowledge-base 1.2.4 → 1.2.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/en.d.ts +2 -0
- package/dist/esm/en.js +749 -184
- package/dist/esm/zh.js +476 -98
- package/dist/iife/en.js +738 -173
- package/dist/iife/zh.js +460 -82
- package/dist/zh.d.ts +2 -0
- package/package.json +2 -2
package/dist/esm/en.js
CHANGED
|
@@ -469,7 +469,7 @@ Nightingale/Flashcat to Flashduty alert severity mapping:
|
|
|
469
469
|
|
|
470
470
|
</details>
|
|
471
471
|
|
|
472
|
-
`,
|
|
472
|
+
`,i=`---
|
|
473
473
|
title: "Prometheus Integration Guide"
|
|
474
474
|
description: "Push Prometheus alert events to Flashduty through AlertManager using webhooks. When an alert is triggered, it sends a trigger event to Flashduty, and when the alert recovers, it sends a recovery event."
|
|
475
475
|
date: "2024-05-11T10:00:00+08:00"
|
|
@@ -651,7 +651,7 @@ Prometheus to Flashduty severity mapping:
|
|
|
651
651
|
|
|
652
652
|
|
|
653
653
|
|
|
654
|
-
`,
|
|
654
|
+
`,o=`---
|
|
655
655
|
title: "Grafana Integration"
|
|
656
656
|
description: "Sync Grafana alert events to Flashduty via webhook to achieve automated alert noise reduction."
|
|
657
657
|
date: "2024-05-11T10:00:00+08:00"
|
|
@@ -3124,7 +3124,7 @@ Choose this option when you need to route alerts to different channels based on
|
|
|
3124
3124
|
|2|Info|Info|
|
|
3125
3125
|
|
|
3126
3126
|
</div>
|
|
3127
|
-
`,
|
|
3127
|
+
`,x=`---
|
|
3128
3128
|
title: "AWS EventBridge Alert Events"
|
|
3129
3129
|
description: "Sync AWS EventBridge alert events to Flashduty via webhook for automated alert noise reduction"
|
|
3130
3130
|
date: "2024-08-20T10:00:00+08:00"
|
|
@@ -3226,7 +3226,7 @@ Choose this option when you need to route alerts to different channels based on
|
|
|
3226
3226
|
|
|
3227
3227
|
</div>
|
|
3228
3228
|
|
|
3229
|
-
`,
|
|
3229
|
+
`,L=`---
|
|
3230
3230
|
title: "Dynatrace Alert Events"
|
|
3231
3231
|
description: "Sync Dynatrace alert events to Flashduty via webhook to achieve automated alert noise reduction."
|
|
3232
3232
|
date: "2024-08-20T10:00:00+08:00"
|
|
@@ -3333,7 +3333,7 @@ Choose this option when you need to route alerts to different channels based on
|
|
|
3333
3333
|
|CUSTOM_ALERT|Info|info|
|
|
3334
3334
|
|
|
3335
3335
|
</div>
|
|
3336
|
-
`,
|
|
3336
|
+
`,_=`---
|
|
3337
3337
|
title: "Huawei Cloud LTS Alert Events"
|
|
3338
3338
|
description: "Sync Huawei Cloud Log Tank Service (LTS) alert events to Flashduty via webhook for automated alert noise reduction."
|
|
3339
3339
|
date: "2024-08-20T10:00:00+08:00"
|
|
@@ -3446,7 +3446,7 @@ Choose this option when you need to route alerts to different channels based on
|
|
|
3446
3446
|
|Info|Info|Info|
|
|
3447
3447
|
|
|
3448
3448
|
</div>
|
|
3449
|
-
`,
|
|
3449
|
+
`,F=`---
|
|
3450
3450
|
title: "Google Cloud Monitoring Alert Events"
|
|
3451
3451
|
description: "Sync Google Cloud Monitoring alert events to Flashduty via webhook for automated alert noise reduction"
|
|
3452
3452
|
date: "2024-07-05T10:00:00+08:00"
|
|
@@ -3875,7 +3875,7 @@ Choose this option when you need to route alerts to different channels based on
|
|
|
3875
3875
|
|Info|Info|Info|
|
|
3876
3876
|
|
|
3877
3877
|
</div>
|
|
3878
|
-
`,
|
|
3878
|
+
`,D=`---
|
|
3879
3879
|
title: "Volcengine Cloud Monitor Alert Events"
|
|
3880
3880
|
description: "Sync Volcengine Cloud Monitor alert events to Flashduty via webhook for automated alert noise reduction"
|
|
3881
3881
|
date: "2024-08-20T10:00:00+08:00"
|
|
@@ -3964,7 +3964,7 @@ Choose this method when you need to route alerts to different channels based on
|
|
|
3964
3964
|
|Notice|Info|Info|
|
|
3965
3965
|
|
|
3966
3966
|
</div>
|
|
3967
|
-
`,
|
|
3967
|
+
`,E=`---
|
|
3968
3968
|
title: "Volcengine Cloud Monitor Event Center Alert Events"
|
|
3969
3969
|
description: "Sync Volcengine Cloud Monitor Event Center alert events to Flashduty via webhook for automated alert noise reduction"
|
|
3970
3970
|
date: "2024-07-05T10:00:00+08:00"
|
|
@@ -4745,6 +4745,94 @@ When you need to route alerts to different channels based on alert payload infor
|
|
|
4745
4745
|
|
|
4746
4746
|
</div>
|
|
4747
4747
|
|
|
4748
|
+
`,j=`---
|
|
4749
|
+
title: "zstack integration"
|
|
4750
|
+
description: "Push ZStack alerts to Flashduty via webhook, to achieve automatic alert noise reduction."
|
|
4751
|
+
date: "2024-07-05T10:00:00+08:00"
|
|
4752
|
+
url: "https://docs.flashcat.cloud/en/flashduty/zstack-integration-guide"
|
|
4753
|
+
---
|
|
4754
|
+
|
|
4755
|
+
Push ZStack alerts to Flashduty via webhook, to achieve automatic alert noise reduction.
|
|
4756
|
+
|
|
4757
|
+
<div class="hide">
|
|
4758
|
+
|
|
4759
|
+
## In Flashduty
|
|
4760
|
+
---
|
|
4761
|
+
You can obtain an integration push URL through either of these two methods:
|
|
4762
|
+
|
|
4763
|
+
### Using Dedicated Integration
|
|
4764
|
+
|
|
4765
|
+
Choose this method when you don't need to route alert events to different channels. It's simpler and recommended.
|
|
4766
|
+
|
|
4767
|
+
<details>
|
|
4768
|
+
<summary>Expand</summary>
|
|
4769
|
+
|
|
4770
|
+
1. Go to the Flashduty console, select **Channel**, and enter a channel's details page
|
|
4771
|
+
2. Select the **Integration** tab, click **Add Integration** to enter the integration page
|
|
4772
|
+
3. Choose **ZStack** integration and click **Save** to generate a card
|
|
4773
|
+
4. Click the generated card to view the **push URL**, copy it for later use, and you're done
|
|
4774
|
+
|
|
4775
|
+
</details>
|
|
4776
|
+
|
|
4777
|
+
### Using Shared Integration
|
|
4778
|
+
|
|
4779
|
+
Choose this method when you need to route alerts to different channels based on the alert event's payload information.
|
|
4780
|
+
|
|
4781
|
+
<details>
|
|
4782
|
+
<summary>Expand</summary>
|
|
4783
|
+
|
|
4784
|
+
1. Go to the Flashduty console, select **Integration Center=>Alert Events** to enter the integration selection page
|
|
4785
|
+
2. Select **ZStack** integration:
|
|
4786
|
+
- **Integration Name**: Define a name for this integration
|
|
4787
|
+
3. Click **Save** and copy the newly generated **push URL** for later use
|
|
4788
|
+
4. Click **Create Route** to configure routing rules for the integration. You can match different alerts to different channels based on conditions, or set a default channel as a fallback and adjust as needed later
|
|
4789
|
+
5. Done
|
|
4790
|
+
|
|
4791
|
+
</details>
|
|
4792
|
+
</div>
|
|
4793
|
+
|
|
4794
|
+
|
|
4795
|
+
## In ZStack
|
|
4796
|
+
---
|
|
4797
|
+
|
|
4798
|
+
<div class="md-block">
|
|
4799
|
+
|
|
4800
|
+
## 一、Create Notification Object
|
|
4801
|
+
|
|
4802
|
+
### Step 1: Create Notification Object
|
|
4803
|
+
1. Login to your \`ZStack\` console, find \`Cloud Monitoring\` in the \`Platform O&M\` menu
|
|
4804
|
+
2. Click \`Endpoint\`, click \`Create Endpoint\` or edit the existing endpoint
|
|
4805
|
+
3. In the edit page, Name it \`Flashduty\`, select \`Webhook\` type, and fill in the <span class='integration_url'>push URL</span> of the alert integration
|
|
4806
|
+
4. Click \`Send Test Message\`, if the message is sent successfully, it means the configuration is successful
|
|
4807
|
+
5. Click \`OK\` to complete the configuration
|
|
4808
|
+
|
|
4809
|
+
<img alt="drawing" width="600" src="https://download.flashcat.cloud/flashduty/doc/en/fd/zstack-1.png" />
|
|
4810
|
+
|
|
4811
|
+
### Step 2: Use Notification Object in Alert Policy
|
|
4812
|
+
|
|
4813
|
+
1. Login to your \`ZStack\` console, find \`Cloud Monitoring\` in the \`Platform O&M\` menu
|
|
4814
|
+
2. Click \`Alarm\`, click \`Create Resource Alarm\` or \`Create Event Alarm\`, or edit the existing alarm object
|
|
4815
|
+
3. In the edit page, select the created \`Flashduty\` Endpoint (\`Resource Alarm\` is recommended to open the recovery notification)
|
|
4816
|
+
4. Configure other settings as needed, and click \`OK\` to complete the configuration
|
|
4817
|
+
|
|
4818
|
+
<img alt="drawing" width="600" src="https://download.flashcat.cloud/flashduty/doc/en/fd/zstack-2.png" />
|
|
4819
|
+
|
|
4820
|
+
|
|
4821
|
+
|
|
4822
|
+
</dev>
|
|
4823
|
+
|
|
4824
|
+
## 二、Status Mapping
|
|
4825
|
+
|
|
4826
|
+
<div class="md-block">
|
|
4827
|
+
|
|
4828
|
+
| ZStack | Flashduty | Status |
|
|
4829
|
+
| ---------- | -------- | ---- |
|
|
4830
|
+
| Emergent | Critical | Critical |
|
|
4831
|
+
| Major | Warning | Warning |
|
|
4832
|
+
| Info | Info | Info |
|
|
4833
|
+
|
|
4834
|
+
</div>
|
|
4835
|
+
|
|
4748
4836
|
`,O=`---
|
|
4749
4837
|
title: "Custom Change Event Integration Guide"
|
|
4750
4838
|
description: "Push change events from your own systems to Flashduty using standard protocols. Most incidents are caused by changes, and the correlation between changes and alerts helps quickly identify incident causes."
|
|
@@ -4802,7 +4890,7 @@ Labels are descriptions of events. You should enrich label content as much as po
|
|
|
4802
4890
|
|
|
4803
4891
|
</details>
|
|
4804
4892
|
|
|
4805
|
-
`,
|
|
4893
|
+
`,H=`---
|
|
4806
4894
|
title: "Jira Issue Events"
|
|
4807
4895
|
description: "Sync Jira Issue events to Flashduty via webhooks to collect change events."
|
|
4808
4896
|
date: "2024-05-11T10:00:00+08:00"
|
|
@@ -5011,7 +5099,7 @@ Once published, you can access the application via mobile/PC client. First-time
|
|
|
5011
5099
|
|Group Bot Webhook|Maximum 100 calls/minute|
|
|
5012
5100
|
|Sending messages to the same user or group|Maximum 5 calls/second|
|
|
5013
5101
|
|
|
5014
|
-
**Note:** Messages cannot be pushed normally when exceeding limits, please use notification channels reasonably`,
|
|
5102
|
+
**Note:** Messages cannot be pushed normally when exceeding limits, please use notification channels reasonably`,B=`---
|
|
5015
5103
|
title: "Dingtalk Integration"
|
|
5016
5104
|
description: "Integrate with Dingtalk custom application to receive and respond to alerts within Dingtalk"
|
|
5017
5105
|
date: "2024-05-11T10:00:00+08:00"
|
|
@@ -5167,7 +5255,7 @@ After the application is released, you can access it via mobile/PC client. First
|
|
|
5167
5255
|
|Enterprise|5,500,000|60|1st of each month|
|
|
5168
5256
|
|
|
5169
5257
|
**Note:** Messages cannot be pushed normally after exceeding limits, please use notification channels reasonably
|
|
5170
|
-
`,
|
|
5258
|
+
`,z=`---
|
|
5171
5259
|
title: "WeCom Integration"
|
|
5172
5260
|
description: "Integrate WeCom third-party application to receive and respond to alerts within WeCom"
|
|
5173
5261
|
date: "2024-05-11T10:00:00+08:00"
|
|
@@ -5300,7 +5388,7 @@ Integrate with Slack to receive and respond to alerts within Slack.
|
|
|
5300
5388
|
|
|
5301
5389
|
8. **Slack App shows Other questions error**
|
|
5302
5390
|
- Try again, as this might be an unrecorded issue
|
|
5303
|
-
- If the error persists, contact customer support`,
|
|
5391
|
+
- If the error persists, contact customer support`,J=`---
|
|
5304
5392
|
title: "Microsoft Teams Integration"
|
|
5305
5393
|
description: "Integrate Microsoft Teams as a third-party application to receive and respond to alerts within Microsoft Teams"
|
|
5306
5394
|
date: "2024-05-11T10:00:00+08:00"
|
|
@@ -5586,6 +5674,7 @@ The following event types are currently supported, with more potentially being a
|
|
|
5586
5674
|
| i_rslv | Close incident (automatically or manually) |
|
|
5587
5675
|
| i_reopen | Reopen incident |
|
|
5588
5676
|
| i_merge | Manually merge incidents |
|
|
5677
|
+
| i_comm | Add comment |
|
|
5589
5678
|
| i_r_title | Update incident title |
|
|
5590
5679
|
| i_r_desc | Update incident description |
|
|
5591
5680
|
| i_r_impact | Update incident impact |
|
|
@@ -5769,7 +5858,7 @@ curl -X POST 'https://example.com/incident/webhook?a=a' \\
|
|
|
5769
5858
|
|
|
5770
5859
|
4. **Trusted IP whitelist for push sources?**
|
|
5771
5860
|
- {ip_whitelist}
|
|
5772
|
-
- May be updated in the future, please check periodically`,
|
|
5861
|
+
- May be updated in the future, please check periodically`,Q=`Custom incident actions allow you to quickly invoke external interfaces during incident troubleshooting for incident self-healing, information enrichment, and other custom operations.
|
|
5773
5862
|
|
|
5774
5863
|
## I. Creating Actions
|
|
5775
5864
|
|
|
@@ -6016,7 +6105,89 @@ When an incident occurs and is confirmed to be caused by a change, directly trig
|
|
|
6016
6105
|
|
|
6017
6106
|
### Update Status Page
|
|
6018
6107
|
|
|
6019
|
-
When an incident is confirmed to affect online services, trigger external status page updates to prompt`,
|
|
6108
|
+
When an incident is confirmed to affect online services, trigger external status page updates to prompt`,X=`---
|
|
6109
|
+
title: "Jira Sync"
|
|
6110
|
+
description: "Sync incidents with Jira issues through Jira Sync Webhook."
|
|
6111
|
+
date: "2024-05-11T10:00:00+08:00"
|
|
6112
|
+
url: "https://docs.flashcat.cloud/en/flashduty/jira-sync"
|
|
6113
|
+
---
|
|
6114
|
+
|
|
6115
|
+
Through Jira Sync Webhook, you can associate and synchronize Flashduty incidents with Jira Issues, enabling integration between Flashduty and Jira.
|
|
6116
|
+
|
|
6117
|
+
## Prerequisites
|
|
6118
|
+
- This integration is compatible with Jira Cloud, as well as versions 7.x and 8.x of Jira Server and Jira Data Center.
|
|
6119
|
+
- Currently, only one-way synchronization of incident information and status to Jira is supported. Information in Jira will not sync back to Flashduty.
|
|
6120
|
+
- For Jira Cloud, use an API Token in the password field during authorization configuration; for Jira Server or Data Center, use your Jira account password.
|
|
6121
|
+
|
|
6122
|
+
## Getting API Token in Jira Cloud (Jira Server and Data Center please skip)
|
|
6123
|
+
|
|
6124
|
+
- After logging into Jira Cloud, click your profile picture in the top right corner and select **Manage Account**.
|
|
6125
|
+
- On the **Manage Account** page, select the **Security** tab.
|
|
6126
|
+
- On the **Security** page, click **Create and manage API tokens**.
|
|
6127
|
+
- In the **Create and manage API tokens** dialog, enter an API token name and select an expiration time.
|
|
6128
|
+
- Click **Create** to generate the API token.
|
|
6129
|
+
- Copy the API token value and paste it into the API token field in Flashduty's authorization configuration.
|
|
6130
|
+
|
|
6131
|
+
## Configuring Integration in Flashduty
|
|
6132
|
+
|
|
6133
|
+
### 1. Create and Authenticate Jira Integration
|
|
6134
|
+
<div class="hide">
|
|
6135
|
+
|
|
6136
|
+
In the Integration Center, select **Webhook**, choose **Jira Sync** integration, and fill in the following authentication information.
|
|
6137
|
+
|
|
6138
|
+
</div>
|
|
6139
|
+
|
|
6140
|
+
- **Jira Platform Type**: Choose based on your version. For Data Center version, select Self-hosted (Server).
|
|
6141
|
+
- **Service URL**: For Cloud version, enter your actual access URL, e.g., https://your-domain.atlassian.net. For Server version, enter your service access URL, e.g., https://your-jira-server-url.com.
|
|
6142
|
+
- **Username**: Your Jira account name. For Cloud version, enter your email; for Server version, enter your Jira username.
|
|
6143
|
+
- **API Token/Password**: Your Jira account credentials. For Cloud version, enter API Token; for Server version, enter your Jira account password.
|
|
6144
|
+
- After completion, click **Next** to proceed with configuration.
|
|
6145
|
+
|
|
6146
|
+
**About Permissions**: Ensure your Jira account has permissions to access relevant projects, issue types, and create issues. Using an administrator account is recommended.
|
|
6147
|
+
|
|
6148
|
+
### 2. Jira Integration Configuration
|
|
6149
|
+
|
|
6150
|
+
- **Integration Name**: Define a name for this integration.
|
|
6151
|
+
- **Trigger Mode**:
|
|
6152
|
+
- Automatic: Configure conditions for Flashduty to automatically sync qualifying incidents to Jira.
|
|
6153
|
+
- Manual: Manually trigger Jira sync from the incident details page's more actions menu (integration name serves as trigger name).
|
|
6154
|
+
- **Project ID**: Select the target Jira project for synchronization.
|
|
6155
|
+
- **Issue Type**: Select the target Jira issue type.
|
|
6156
|
+
- **Channel**: Select the channel where this integration will be active. Only incidents within this channel can sync to Jira.
|
|
6157
|
+
- **Severity Mapping**: If the selected issue type doesn't support priority fields, this mapping cannot be configured.
|
|
6158
|
+
- **Custom Field Mapping**: Choose to sync certain or all incident labels and custom field content to Jira fields (text type fields only).
|
|
6159
|
+
|
|
6160
|
+
### 3. About Updates
|
|
6161
|
+
|
|
6162
|
+
- For incidents with existing Jira issues, updates to severity or status will automatically update in Jira, but Jira updates won't sync back to Flashduty.
|
|
6163
|
+
- Comments sync to Jira, but Jira comments won't sync back to Flashduty.
|
|
6164
|
+
- Updates to incident title, description, labels, or other fields won't update in Jira.
|
|
6165
|
+
|
|
6166
|
+
### 4. Flashduty to Jira Mapping
|
|
6167
|
+
|
|
6168
|
+
#### Field Mapping
|
|
6169
|
+
|
|
6170
|
+
| Jira | Flashduty |
|
|
6171
|
+
| ---------- | -------- |
|
|
6172
|
+
| Summary | Title |
|
|
6173
|
+
| Description | Description |
|
|
6174
|
+
| Priority | Severity |
|
|
6175
|
+
| Reporter | Integration configured user |
|
|
6176
|
+
| Comments | Comments |
|
|
6177
|
+
|
|
6178
|
+
#### Status Mapping
|
|
6179
|
+
|
|
6180
|
+
| Jira | Flashduty |
|
|
6181
|
+
| ---------- | -------- |
|
|
6182
|
+
| Todo | Pending |
|
|
6183
|
+
| In Progress | In Progress |
|
|
6184
|
+
| Done | Resolved |
|
|
6185
|
+
|
|
6186
|
+
### 5. Important Notes
|
|
6187
|
+
|
|
6188
|
+
- Flashduty syncs information according to default field mappings and your custom field configurations. If your Jira issue type has required fields without mapping relationships, Jira issue creation may fail.
|
|
6189
|
+
- Jira issue details are accessed using project KEY + number format. If you modify the project KEY, saved issue URLs in Flashduty may become inaccessible, so please modify project KEYs with caution.
|
|
6190
|
+
`,ee=`---
|
|
6020
6191
|
title: "Configure Notification Templates"
|
|
6021
6192
|
description: "Customize notification content through template configuration"
|
|
6022
6193
|
date: "2024-05-10T10:00:00+08:00"
|
|
@@ -6031,25 +6202,25 @@ url: "https://docs.flashcat.cloud/en/flashduty/template-settings"
|
|
|
6031
6202
|
|
|
6032
6203
|
## When Are Templates Used?
|
|
6033
6204
|
---
|
|
6034
|
-
The system uses templates to render [Incident](#Incident)
|
|
6205
|
+
The system uses templates to render [Incident](#Incident) when assigning incidents, which may occur in the following scenarios:
|
|
6035
6206
|
|
|
6036
6207
|
1. Manually create and assign an incident
|
|
6037
6208
|
2. When an alert event is reported, the system automatically generates an incident and assigns it according to the matched escalation rule
|
|
6038
6209
|
3. After an incident is created, manually change the assignment (reassign)
|
|
6039
|
-
4.
|
|
6210
|
+
4. System automatically escalates according to escalation rule settings
|
|
6040
6211
|
5. When reopening a closed incident, reassign according to previous settings
|
|
6041
6212
|
|
|
6042
|
-
We use \`Golang template syntax\` [template/html](https://pkg.go.dev/html/template@go1.18.1) to parse data,
|
|
6213
|
+
We use \`Golang template syntax\` [template/html](https://pkg.go.dev/html/template@go1.18.1) to parse data, enabling you to accomplish any complex rendering requirements.
|
|
6043
6214
|
|
|
6044
|
-
- For documentation, please refer to [here](https://www.topgoer.com/%E5%B8%B8%E7%94%A8%E6%A0%87%E5%87%86%E5%BA%93/template.html#%E6%A8%A1%E6%9D%BF%E8%AF%AD%E6%B3%95), supporting logical conditions, loops, pipelines and common functions
|
|
6045
|
-
- We
|
|
6046
|
-
- If you
|
|
6215
|
+
- For documentation, please refer to [here](https://www.topgoer.com/%E5%B8%B8%E7%94%A8%E6%A0%87%E5%87%86%E5%BA%93/template.html#%E6%A8%A1%E6%9D%BF%E8%AF%AD%E6%B3%95), supporting logical conditions, loops, pipelines, and common functions;
|
|
6216
|
+
- We've incorporated the open-source library [sprig](https://github.com/flashcatcloud/sprig/tree/flashcat), which includes hundreds of common functions that you can directly call in templates;
|
|
6217
|
+
- If you wish to introduce more functions, feel free to submit a merge request
|
|
6047
6218
|
|
|
6048
6219
|
## What Variables Can I Reference?
|
|
6049
6220
|
---
|
|
6050
6221
|
**Variable Reference Examples**:
|
|
6051
6222
|
|
|
6052
|
-
\`\`\`
|
|
6223
|
+
\`\`\`go
|
|
6053
6224
|
// Reference title
|
|
6054
6225
|
{{.Title}}
|
|
6055
6226
|
|
|
@@ -6071,7 +6242,7 @@ ID | string | Yes | Incident ID
|
|
|
6071
6242
|
\`Title\` | string | Yes | Incident title
|
|
6072
6243
|
\`Description\` | string | Yes | Incident description, can be empty
|
|
6073
6244
|
DetailUrl | string | Yes | Incident detail page URL
|
|
6074
|
-
Num | string | Yes | Short incident identifier, for easy visual recognition
|
|
6245
|
+
Num | string | Yes | Short incident identifier, for easy visual recognition, may be duplicate
|
|
6075
6246
|
\`IncidentSeverity\` | string | Yes | Severity level, enum values: Critical, Warning, Info
|
|
6076
6247
|
IncidentStatus | string | Yes | Incident status, enum values: Critical, Warning, Info, Ok
|
|
6077
6248
|
\`Progress\` | string | Yes | Processing progress, enum values: Triggered, Processing, Closed
|
|
@@ -6080,19 +6251,19 @@ LastTime | int64 | No | Latest event time, latest incorporated event time in ass
|
|
|
6080
6251
|
EndTime | int64 | No | Recovery time, when all associated alerts recover, the incident will automatically recover and close. Unix timestamp in seconds, default 0
|
|
6081
6252
|
SnoozedBefore | int64 | No | Snooze end time, Unix timestamp in seconds, default 0
|
|
6082
6253
|
AckTime | int64 | No | First acknowledgment time, Unix timestamp in seconds, default 0
|
|
6083
|
-
CloseTime | int64 | No | Close time, end_time is incident recovery time, close_time is processing progress close time. Incident automatically closes
|
|
6084
|
-
Creator | [Person](#Person) | No | Creator information,
|
|
6085
|
-
Closer | [Person](#Person) | No | Closer information,
|
|
6254
|
+
CloseTime | int64 | No | Close time, end_time is incident recovery time, close_time is processing progress close time. Incident automatically closes upon recovery, manual closure doesn't affect recovery. Unix timestamp in seconds, default 0
|
|
6255
|
+
Creator | [Person](#Person) | No | Creator information, not present when automatically generated by system
|
|
6256
|
+
Closer | [Person](#Person) | No | Closer information, not present when incident recovers automatically
|
|
6086
6257
|
AssignedTo | [Assignment](Assignment) | No | Assignment configuration
|
|
6087
|
-
Responders | [][Responder](#Responder) | No |
|
|
6258
|
+
Responders | [][Responder](#Responder) | No | Responder list, initialized based on assignment configuration, also includes records if non-assigned personnel acknowledge the incident
|
|
6088
6259
|
ChannelID | int64 | No | Channel ID, value is 0 when manually creating global incident
|
|
6089
6260
|
ChannelName | string | No | Channel name
|
|
6090
6261
|
GroupMethod | string | No | Grouping method, enum values: n: no grouping, p: rule-based grouping, i: intelligent grouping
|
|
6091
|
-
\`Labels\` | map[string]string | No | Label key-value pairs, both Key and Value are strings. No information when manually created,
|
|
6262
|
+
\`Labels\` | map[string]string | No | Label key-value pairs, both Key and Value are strings. No information when manually created, contains first alert's label information when automatically created
|
|
6092
6263
|
AlertCnt | int64 | Yes | Number of associated alerts
|
|
6093
6264
|
Alerts | [][Alert](#Alert) | No | Associated alert details, no information when manually created
|
|
6094
6265
|
FireType | string | No | Notification type, enum values: fire: notify, refire: loop notification
|
|
6095
|
-
IsFlapping | bool | No | Whether in flapping state, i.e
|
|
6266
|
+
IsFlapping | bool | No | Whether in flapping state, i.e., frequent occurrence and recovery, related to convergence configuration
|
|
6096
6267
|
Impact | string | No | Incident impact, filled after incident closure
|
|
6097
6268
|
RootCause | string | No | Root cause, filled after incident closure
|
|
6098
6269
|
Resolution | string | No | Resolution, filled after incident closure
|
|
@@ -6109,11 +6280,11 @@ email | string | Yes | Email address
|
|
|
6109
6280
|
**Assignment** (Indirect Reference):
|
|
6110
6281
|
Field|Type|Required|Description
|
|
6111
6282
|
:-:|:-:|:-:|:---
|
|
6112
|
-
PersonIDs | []string| No |
|
|
6283
|
+
PersonIDs | []string| No | Person ID list, exists only when assigning by person
|
|
6113
6284
|
EscalateRuleID | string | No | Escalation rule ID, exists only when assigning by rule
|
|
6114
6285
|
EscalateRuleName | string | No | Escalation rule name
|
|
6115
6286
|
LayerIdx | string | No | Assignment level, corresponds to escalation rule level index, starts from 0
|
|
6116
|
-
Type | string | Yes | Assignment type, enum values: assign: assign, reassign: reassign, escalate:
|
|
6287
|
+
Type | string | Yes | Assignment type, enum values: assign: assign, reassign: reassign, escalate: escalation assign, reopen: reopen assign
|
|
6117
6288
|
|
|
6118
6289
|
<span id="Responder"></span>
|
|
6119
6290
|
**Responder** (Indirect Reference):
|
|
@@ -6136,44 +6307,44 @@ AlertStatus | string | Yes | Alert status, enum values: Critical, Warning, Info,
|
|
|
6136
6307
|
Progress | string | Yes | Processing progress, enum values: Triggered, Processing, Closed
|
|
6137
6308
|
StartTime | int64 | Yes | Trigger time, Unix timestamp in seconds
|
|
6138
6309
|
EndTime | int64 | No | Recovery time, Unix timestamp in seconds, default 0
|
|
6139
|
-
CloseTime | int64 | No | Close time, EndTime is alert recovery time, CloseTime is processing progress close time. Alert automatically closes
|
|
6310
|
+
CloseTime | int64 | No | Close time, EndTime is alert recovery time, CloseTime is processing progress close time. Alert automatically closes upon recovery, manual closure doesn't affect alert recovery. Unix timestamp in seconds, default 0
|
|
6140
6311
|
\`Labels\` | map[string]string | No | Label key-value pairs, both Key and Value are strings
|
|
6141
6312
|
|
|
6142
|
-
##
|
|
6313
|
+
## Common Questions
|
|
6143
6314
|
---
|
|
6144
|
-
1. **How do I know what label information is in \`Labels\`?**
|
|
6315
|
+
1. **How do I know what label information is available in \`Labels\`?**
|
|
6145
6316
|
|
|
6146
6317
|
- Manually created incidents have no labels
|
|
6147
|
-
- Automatically created incidents have labels,
|
|
6318
|
+
- Automatically created incidents have labels, matching the first incorporated alert's labels. Go to the \`Incidents\` page, find an incident and view its details to see all label information
|
|
6148
6319
|
|
|
6149
6320
|
2. **Why is the \`default template\` used when I configured custom template rendering?**
|
|
6150
6321
|
|
|
6151
6322
|
- When creating a custom template, the system uses mock data to render the template to check for syntax errors
|
|
6152
|
-
- Mock data has limited coverage and may not match some
|
|
6153
|
-
-
|
|
6154
|
-
- When unsure if a referenced variable exists, it's recommended to use logical conditions to avoid rendering
|
|
6323
|
+
- Mock data has limited coverage and may not match some logic branches in your template during actual operation
|
|
6324
|
+
- If rendering fails, the system will use the default template as a fallback to ensure message delivery
|
|
6325
|
+
- When unsure if a referenced variable exists, it's recommended to use logical conditions to avoid rendering errors, e.g., for the \`resource\` label:
|
|
6155
6326
|
|
|
6156
|
-
\`\`\`
|
|
6327
|
+
\`\`\`go
|
|
6157
6328
|
// Wrong approach: directly read label
|
|
6158
6329
|
{{.Labels.resource}}
|
|
6159
6330
|
|
|
6160
|
-
// Recommended
|
|
6331
|
+
// Recommended: check first, then read label
|
|
6161
6332
|
{{if .Labels.resource}}{{.Labels.resource}}{{end}}
|
|
6162
6333
|
\`\`\`
|
|
6163
6334
|
|
|
6164
|
-
3. **Why are characters like ">" \`escaped\` in
|
|
6335
|
+
3. **Why are characters like ">" \`escaped\` in incident titles?**
|
|
6165
6336
|
|
|
6166
|
-
\`\`\`
|
|
6337
|
+
\`\`\`go
|
|
6167
6338
|
// Use toHtml function
|
|
6168
6339
|
{{toHtml .Title}}
|
|
6169
6340
|
|
|
6170
|
-
// Use first non-empty value for rendering,
|
|
6341
|
+
// Use first non-empty value for rendering, avoiding complex if logic
|
|
6171
6342
|
{{toHtml .Title .TitleEnglish}}
|
|
6172
6343
|
\`\`\`
|
|
6173
6344
|
|
|
6174
|
-
4. **Time variables are timestamps, how
|
|
6345
|
+
4. **Time variables are timestamps, how do I \`convert time formats\`?**
|
|
6175
6346
|
|
|
6176
|
-
\`\`\`
|
|
6347
|
+
\`\`\`go
|
|
6177
6348
|
// date function converts timestamp to readable format
|
|
6178
6349
|
// "2006-01-02 15:04:05" is a common format, search online for more formats
|
|
6179
6350
|
{{date "2006-01-02 15:04:05" .StartTime}}
|
|
@@ -6183,24 +6354,24 @@ CloseTime | int64 | No | Close time, EndTime is alert recovery time, CloseTime i
|
|
|
6183
6354
|
\`\`\`
|
|
6184
6355
|
|
|
6185
6356
|
5. **How to reference external variables inside a for loop?**
|
|
6186
|
-
\`\`\`
|
|
6357
|
+
\`\`\`go
|
|
6187
6358
|
// Add "$" before external variables
|
|
6188
6359
|
{{range .Responders}}
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6360
|
+
{{if eq $.Progress "Triggered"}}
|
|
6361
|
+
[Pending]{{.Email}}
|
|
6362
|
+
{{end}}
|
|
6192
6363
|
{{end}}
|
|
6193
6364
|
\`\`\`
|
|
6194
|
-
6. **How
|
|
6365
|
+
6. **How do I extract field values with "." in names, like "obj.instance" in labels?**
|
|
6195
6366
|
|
|
6196
|
-
\`\`\`
|
|
6367
|
+
\`\`\`go
|
|
6197
6368
|
// Use index function
|
|
6198
6369
|
{{index .Labels "obj.instance"}}
|
|
6199
6370
|
\`\`\`
|
|
6200
6371
|
|
|
6201
|
-
7. **How
|
|
6372
|
+
7. **How do I extract and deduplicate label information from incident-associated alerts?**
|
|
6202
6373
|
|
|
6203
|
-
\`\`\`
|
|
6374
|
+
\`\`\`go
|
|
6204
6375
|
// Use alertLabels function to get deduplicated array
|
|
6205
6376
|
{{alertLabels . "resource"}}
|
|
6206
6377
|
|
|
@@ -6208,9 +6379,9 @@ CloseTime | int64 | No | Close time, EndTime is alert recovery time, CloseTime i
|
|
|
6208
6379
|
{{joinAlertLabels . "resource" "sep"}}
|
|
6209
6380
|
\`\`\`
|
|
6210
6381
|
|
|
6211
|
-
8. **How
|
|
6382
|
+
8. **How do I iterate and print labels?**
|
|
6212
6383
|
|
|
6213
|
-
\`\`\`
|
|
6384
|
+
\`\`\`go
|
|
6214
6385
|
// Complete iteration
|
|
6215
6386
|
{{range $k, $v := .Labels}}
|
|
6216
6387
|
{{$k}} : {{toHtml $v}}
|
|
@@ -6230,36 +6401,38 @@ CloseTime | int64 | No | Close time, EndTime is alert recovery time, CloseTime i
|
|
|
6230
6401
|
{{end}}
|
|
6231
6402
|
{{end}}
|
|
6232
6403
|
|
|
6233
|
-
9. **How
|
|
6404
|
+
9. **How do I extract information from JSON fields?**
|
|
6234
6405
|
|
|
6235
|
-
-
|
|
6236
|
-
- Target data
|
|
6406
|
+
- jsonGet function helps extract values from JSON format data using path
|
|
6407
|
+
- Target data for jsonGet function must be valid JSON
|
|
6237
6408
|
- Basic usage: {{jsonGet .Labels.xxx "yyy"}}, where xxx must be valid JSON and yyy is a valid extraction path
|
|
6238
6409
|
- For JSON path syntax, refer to [gjson.dev](https://gjson.dev/), where you can input target data and extraction path for real-time preview
|
|
6239
6410
|
|
|
6240
|
-
\`\`\`
|
|
6411
|
+
\`\`\`go
|
|
6241
6412
|
// Extract detail_url field from rule_note label
|
|
6242
6413
|
{{jsonGet .Labels.rule_note "detail_url"}}
|
|
6243
6414
|
|
|
6244
6415
|
// Extract name field from first element in JSON array
|
|
6245
6416
|
{{jsonGet .Labels.slice "0.name"}}
|
|
6246
6417
|
|
|
6247
|
-
// Iterate
|
|
6418
|
+
// Iterate through JSON array elements, match instanceId field of object with userId==7777
|
|
6248
6419
|
{{jsonGet .Labels.rule_note "#(userId==7777)#.instanceId" }}
|
|
6249
6420
|
|
|
6250
6421
|
\`\`\`
|
|
6251
6422
|
|
|
6252
|
-
10. **
|
|
6423
|
+
10. **How do I find more functions and their usage examples?**
|
|
6253
6424
|
- Function list: https://github.com/flashcatcloud/sprig/blob/master/functions.go#L97
|
|
6254
|
-
- Usage examples: Check corresponding _test.go files, e.g
|
|
6425
|
+
- Usage examples: Check corresponding _test.go files, e.g., date function test cases at https://github.com/flashcatcloud/sprig/blob/master/date_test.go
|
|
6255
6426
|
|
|
6256
|
-
Below are specific instructions for each notification channel.
|
|
6427
|
+
Below are specific instructions for each notification channel.
|
|
6428
|
+
|
|
6429
|
+
<div class="feishu_app hide">
|
|
6257
6430
|
|
|
6258
6431
|
## Feishu/Lark App
|
|
6259
6432
|
---
|
|
6260
|
-
You need to configure \`Integration Center
|
|
6433
|
+
You need to configure \`Integration Center-Instant Message-Feishu\` integration first to send message cards. If custom content is not set, the system default template will be used, rendering all label information:
|
|
6261
6434
|
|
|
6262
|
-
\`\`\`
|
|
6435
|
+
\`\`\`go
|
|
6263
6436
|
{{if .Description}}**description** :{{toHtml .Labels.body_text .Description}}{{end}}
|
|
6264
6437
|
{{if .Labels.resource}}**resource** : {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
|
|
6265
6438
|
{{range $k, $v := .Labels}}
|
|
@@ -6268,15 +6441,14 @@ You need to configure \`Integration Center - IM - Feishu/Lark\` integration firs
|
|
|
6268
6441
|
|
|
6269
6442
|
As shown below:
|
|
6270
6443
|
|
|
6271
|
-
<img src="https://download.flashcat.cloud/flashduty/
|
|
6444
|
+
<img src="https://download.flashcat.cloud/flashduty/changelog/20230720/feishu_app_render.png" alt="drawing" style="display: block; margin: 0 auto;" width="500"/>
|
|
6272
6445
|
|
|
6446
|
+
If you want to display only key label information, you can refer to the code segment below:
|
|
6273
6447
|
|
|
6274
|
-
|
|
6448
|
+
- We've listed some common labels, you can add or remove as needed
|
|
6449
|
+
- In Feishu app, the system will automatically remove empty rendered lines (due to non-existent labels), so you can configure freely
|
|
6275
6450
|
|
|
6276
|
-
|
|
6277
|
-
- In Feishu/Lark app, the system will automatically remove empty lines (caused by non-existent labels) during rendering, so you can configure freely
|
|
6278
|
-
|
|
6279
|
-
\`\`\`
|
|
6451
|
+
\`\`\`go
|
|
6280
6452
|
{{if (index .Labels "resource")}}resource:{{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
|
|
6281
6453
|
{{if (index .Labels "check")}}check:{{toHtml (index .Labels "check")}}{{end}}
|
|
6282
6454
|
{{if (index .Labels "metric")}}metric:{{index .Labels "metric"}}{{end}}
|
|
@@ -6298,12 +6470,15 @@ If you want to display only key label information, you can refer to the code sni
|
|
|
6298
6470
|
{{if (index .Labels "mode")}}mode:{{index .Labels "mode"}}{{end}}
|
|
6299
6471
|
{{if (index .Labels "runbook_url")}}runbook_url:{{toHtml (index .Labels "runbook_url")}}{{end}}
|
|
6300
6472
|
\`\`\`
|
|
6473
|
+
</div>
|
|
6474
|
+
|
|
6475
|
+
<div class="dingtalk_app hide">
|
|
6301
6476
|
|
|
6302
6477
|
## Dingtalk App
|
|
6303
6478
|
---
|
|
6304
|
-
You need to configure \`Integration Center
|
|
6479
|
+
You need to configure \`Integration Center-Instant Message-Dingtalk\` integration first to send message cards. If custom content is not set, the system default template will be used, rendering all label information:
|
|
6305
6480
|
|
|
6306
|
-
\`\`\`
|
|
6481
|
+
\`\`\`go
|
|
6307
6482
|
{{if .Description}}**description** :{{toHtml .Labels.body_text .Description}}{{end}}
|
|
6308
6483
|
{{if .Labels.resource}}**resource** : {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
|
|
6309
6484
|
{{range $k, $v := .Labels}}
|
|
@@ -6311,15 +6486,15 @@ You need to configure \`Integration Center - IM - Dingtalk\` integration first t
|
|
|
6311
6486
|
\`\`\`
|
|
6312
6487
|
|
|
6313
6488
|
As shown below:
|
|
6314
|
-
<img src="https://download.flashcat.cloud/flashduty/doc/en/fd/template-ding-1.png" width="800">
|
|
6315
6489
|
|
|
6490
|
+
<img src="https://download.flashcat.cloud/flashduty/changelog/20230720/dingtalk_app_render.png" alt="drawing" style="display: block; margin: 0 auto;" width="500"/>
|
|
6316
6491
|
|
|
6317
|
-
If you want to display only key label information, you can refer to the code
|
|
6492
|
+
If you want to display only key label information, you can refer to the code segment below:
|
|
6318
6493
|
|
|
6319
|
-
- We've listed some common labels
|
|
6320
|
-
- In Dingtalk app, the system will automatically remove empty lines (
|
|
6494
|
+
- We've listed some common labels, you can add or remove as needed
|
|
6495
|
+
- In Dingtalk app, the system will automatically remove empty rendered lines (due to non-existent labels), so you can configure freely
|
|
6321
6496
|
|
|
6322
|
-
\`\`\`
|
|
6497
|
+
\`\`\`go
|
|
6323
6498
|
{{if (index .Labels "resource")}}**resource**:{{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
|
|
6324
6499
|
{{if (index .Labels "metric")}}**metric**:{{index .Labels "metric"}}{{end}}
|
|
6325
6500
|
{{if (index .Labels "prom_ql")}}**prom_ql**:{{toHtml (index .Labels "prom_ql")}}{{end}}
|
|
@@ -6340,15 +6515,19 @@ If you want to display only key label information, you can refer to the code sni
|
|
|
6340
6515
|
{{if (index .Labels "mode")}}**mode**:{{index .Labels "mode"}}{{end}}
|
|
6341
6516
|
{{if (index .Labels "runbook_url")}}**runbook_url**:{{index .Labels "runbook_url"}}{{end}}
|
|
6342
6517
|
\`\`\`
|
|
6518
|
+
</div>
|
|
6519
|
+
|
|
6520
|
+
<div class="wecom_app hide">
|
|
6343
6521
|
|
|
6344
6522
|
## WeCom App
|
|
6345
6523
|
---
|
|
6346
|
-
You need to configure \`Integration Center - IM - WeCom\` integration first to send message cards. If custom content is not set, the system default template will be used to render only common label information:
|
|
6347
6524
|
|
|
6348
|
-
-
|
|
6349
|
-
- In WeCom app, the system will automatically remove empty lines (caused by non-existent labels) during rendering, so you can configure freely
|
|
6525
|
+
You need to configure \`Integration Center-Instant Message-WeCom\` integration first to send message cards. If custom content is not set, the system default template will be used, rendering only common label information:
|
|
6350
6526
|
|
|
6351
|
-
|
|
6527
|
+
- We've listed some common labels, you can add or remove as needed
|
|
6528
|
+
- In WeCom app, the system will automatically remove empty rendered lines (due to non-existent labels), so you can configure freely
|
|
6529
|
+
|
|
6530
|
+
\`\`\`go
|
|
6352
6531
|
{{if (index .Labels "resource")}}resource:{{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
|
|
6353
6532
|
{{if (index .Labels "metric")}}metric:{{index .Labels "metric"}}{{end}}
|
|
6354
6533
|
{{if (index .Labels "prom_ql")}}prom_ql:{{toHtml (index .Labels "prom_ql")}}{{end}}
|
|
@@ -6372,16 +6551,19 @@ You need to configure \`Integration Center - IM - WeCom\` integration first to s
|
|
|
6372
6551
|
|
|
6373
6552
|
As shown below:
|
|
6374
6553
|
|
|
6375
|
-
<img src="https://download.flashcat.cloud/flashduty/
|
|
6554
|
+
<img src="https://download.flashcat.cloud/flashduty/changelog/20230720/wecom_app_render.png" alt="drawing" style="display: block; margin: 0 auto;" width="500"/>
|
|
6555
|
+
|
|
6556
|
+
**Note: WeCom limits card length. In the template rendering area, you can render no more than 8 lines of content. Content beyond 8 lines will be hidden**
|
|
6376
6557
|
|
|
6558
|
+
</div>
|
|
6377
6559
|
|
|
6378
|
-
|
|
6560
|
+
<div class="slack_app hide">
|
|
6379
6561
|
|
|
6380
6562
|
## Slack App
|
|
6381
6563
|
---
|
|
6382
|
-
You need to configure \`Integration Center
|
|
6564
|
+
You need to configure \`Integration Center-Instant Message-Slack\` integration first to send message cards. If custom content is not set, the system default template will be used, rendering only common label information:
|
|
6383
6565
|
|
|
6384
|
-
\`\`\`
|
|
6566
|
+
\`\`\`go
|
|
6385
6567
|
{{if .Description}}*description* :{{toHtml .Labels.body_text .Description}}{{end}}
|
|
6386
6568
|
{{if .Labels.resource}}*resource* : {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
|
|
6387
6569
|
{{range $k, $v := .Labels}}
|
|
@@ -6392,18 +6574,18 @@ As shown below:
|
|
|
6392
6574
|
|
|
6393
6575
|
<img src="https://download.flashcat.cloud/flashduty/integration/slack/slack_app_message.png" alt="drawing" style="display: block; margin: 0 auto;" width="600"/>
|
|
6394
6576
|
|
|
6395
|
-
If you want to display only key label information, you can refer to the code
|
|
6577
|
+
If you want to display only key label information, you can refer to the code segment below:
|
|
6396
6578
|
|
|
6397
|
-
- We've listed some common labels
|
|
6398
|
-
- Messages can be around 15000 characters long, content beyond
|
|
6399
|
-
- In Slack app, the system will automatically remove empty lines (
|
|
6579
|
+
- We've listed some common labels, you can add or remove as needed
|
|
6580
|
+
- Messages can be around 15000 characters long, content beyond this will be truncated
|
|
6581
|
+
- In Slack app, the system will automatically remove empty rendered lines (due to non-existent labels), so you can configure freely
|
|
6400
6582
|
|
|
6401
|
-
\`\`\`
|
|
6583
|
+
\`\`\`go
|
|
6402
6584
|
{{if (index .Labels "resource")}}*resource*:{{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
|
|
6403
6585
|
{{if (index .Labels "metric")}}*metric*:{{index .Labels "metric"}}{{end}}
|
|
6404
6586
|
{{if (index .Labels "prom_ql")}}*prom_ql*:{{toHtml (index .Labels "prom_ql")}}{{end}}
|
|
6405
6587
|
{{if (index .Labels "trigger_value")}}*trigger_value*:{{index .Labels "trigger_value"}}{{end}}
|
|
6406
|
-
{{if (index .Labels "host_ql")}}*host_ql*:{{
|
|
6588
|
+
{{if (index .Labels "host_ql")}}*host_ql*:{{index .Labels "host_ql"}}{{end}}
|
|
6407
6589
|
{{if (index .Labels "region")}}*region*:{{index .Labels "region"}}{{end}}
|
|
6408
6590
|
{{if (index .Labels "cluster")}}*cluster*:{{index .Labels "cluster"}}{{end}}
|
|
6409
6591
|
{{if (index .Labels "business")}}*business*:{{index .Labels "business"}}{{end}}
|
|
@@ -6418,16 +6600,392 @@ If you want to display only key label information, you can refer to the code sni
|
|
|
6418
6600
|
{{if (index .Labels "name")}}*name*:{{index .Labels "name"}}{{end}}
|
|
6419
6601
|
{{if (index .Labels "mode")}}*mode*:{{index .Labels "mode"}}{{end}}
|
|
6420
6602
|
{{if (index .Labels "runbook_url")}}*runbook_url*:{{index .Labels "runbook_url"}}{{end}}
|
|
6421
|
-
\`\`\`
|
|
6603
|
+
\`\`\`
|
|
6604
|
+
</div>
|
|
6422
6605
|
|
|
6423
|
-
|
|
6606
|
+
<div class="teams_app hide">
|
|
6607
|
+
|
|
6608
|
+
## Microsoft Teams App
|
|
6609
|
+
---
|
|
6610
|
+
You need to configure \`Integration Center-Instant Message-Microsoft Teams\` integration first to send message cards. If custom content is not set, the system default template will be used, rendering only common label information:
|
|
6611
|
+
|
|
6612
|
+
\`\`\`
|
|
6613
|
+
{{if .Description}}**description** :{{toHtml .Labels.body_text .Description}}{{end}}
|
|
6614
|
+
{{if .Labels.resource}}**resource** : {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
|
|
6615
|
+
{{range $k, $v := .Labels}}
|
|
6616
|
+
{{if not (in $k "resource" "body_text" "body_text_with_table")}}**{{$k}}** : {{toHtml $v}}{{end}}{{end}}
|
|
6617
|
+
\`\`\`
|
|
6618
|
+
|
|
6619
|
+
As shown below:
|
|
6620
|
+
|
|
6621
|
+
<img src="https://download.flashcat.cloud/flashduty/integration/microsoft-teams/teams_app_message.png" alt="drawing" style="display: block; margin: 0 auto;" width="300"/>
|
|
6622
|
+
|
|
6623
|
+
If you want to display only key label information, you can refer to the code segment below:
|
|
6624
|
+
|
|
6625
|
+
- We've listed some common labels, you can add or remove as needed
|
|
6626
|
+
- Messages can be around 28KB in size, content beyond this will result in an error
|
|
6627
|
+
- In Microsoft Teams app, the system will automatically remove empty rendered lines (due to non-existent labels), so you can configure freely
|
|
6628
|
+
|
|
6629
|
+
\`\`\`
|
|
6630
|
+
{{if (index .Labels "resource")}}**resource**:{{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
|
|
6631
|
+
{{if (index .Labels "metric")}}**metric**:{{index .Labels "metric"}}{{end}}
|
|
6632
|
+
{{if (index .Labels "prom_ql")}}**prom_ql**:{{toHtml (index .Labels "prom_ql")}}{{end}}
|
|
6633
|
+
{{if (index .Labels "trigger_value")}}**trigger_value**:{{index .Labels "trigger_value"}}{{end}}
|
|
6634
|
+
{{if (index .Labels "host_ql")}}**host_ql**:{{index .Labels "host_ql"}}{{end}}
|
|
6635
|
+
{{if (index .Labels "region")}}**region**:{{index .Labels "region"}}{{end}}
|
|
6636
|
+
{{if (index .Labels "cluster")}}**cluster**:{{index .Labels "cluster"}}{{end}}
|
|
6637
|
+
{{if (index .Labels "business")}}**business**:{{index .Labels "business"}}{{end}}
|
|
6638
|
+
{{if (index .Labels "service")}}**service**:{{index .Labels "service"}}{{end}}
|
|
6639
|
+
{{if (index .Labels "env")}}**env**:{{index .Labels "env"}}{{end}}
|
|
6640
|
+
{{if (index .Labels "type")}}**type**:{{index .Labels "type"}}{{end}}
|
|
6641
|
+
{{if (index .Labels "topic")}}**topic**:{{index .Labels "topic"}}{{end}}
|
|
6642
|
+
{{if (index .Labels "cpu")}}**cpu**:{{index .Labels "cpu"}}{{end}}
|
|
6643
|
+
{{if (index .Labels "device")}}**device**:{{index .Labels "device"}}{{end}}
|
|
6644
|
+
{{if (index .Labels "path")}}**path**:{{index .Labels "path"}}{{end}}
|
|
6645
|
+
{{if (index .Labels "fstype")}}**fstype**:{{index .Labels "fstype"}}{{end}}
|
|
6646
|
+
{{if (index .Labels "name")}}**name**:{{index .Labels "name"}}{{end}}
|
|
6647
|
+
{{if (index .Labels "mode")}}**mode**:{{index .Labels "mode"}}{{end}}
|
|
6648
|
+
{{if (index .Labels "runbook_url")}}**runbook_url**:{{index .Labels "runbook_url"}}{{end}}
|
|
6649
|
+
\`\`\`
|
|
6650
|
+
</div>
|
|
6651
|
+
|
|
6652
|
+
<div class="sms hide">
|
|
6653
|
+
|
|
6654
|
+
## Feishu/Lark Bot
|
|
6655
|
+
---
|
|
6656
|
+
Feishu/Lark bot supports message cards, rich text, and plain text formats. The default template is in message card format.
|
|
6657
|
+
|
|
6658
|
+
- The msg_type field is required for message cards and rich text, otherwise it will be sent as plain text format
|
|
6659
|
+
- The maximum message length is \`4000 bytes, content exceeding this limit will be truncated\`
|
|
6660
|
+
- If no custom content is set, the system default template will be used to display key information:
|
|
6661
|
+
|
|
6662
|
+
1. Message Card
|
|
6663
|
+
msg_type is required, value should be interactive
|
|
6664
|
+
\`\`\`
|
|
6665
|
+
{
|
|
6666
|
+
"msg_type": "interactive",
|
|
6667
|
+
"card": {
|
|
6668
|
+
"config": {
|
|
6669
|
+
"wide_screen_mode": true,
|
|
6670
|
+
"enable_forward": true
|
|
6671
|
+
},
|
|
6672
|
+
"header": {
|
|
6673
|
+
"template": "{{if eq .IncidentSeverity "Critical"}}red{{else if eq .IncidentSeverity "Warning"}}orange{{else}}yellow{{end}}",
|
|
6674
|
+
"title": {
|
|
6675
|
+
"content": "{{fireReason .}}INC #{{.Num}} {{toHtml .Title}}",
|
|
6676
|
+
"tag": "plain_text"
|
|
6677
|
+
}
|
|
6678
|
+
},
|
|
6679
|
+
"elements": [{
|
|
6680
|
+
"tag": "div",
|
|
6681
|
+
"fields": [{
|
|
6682
|
+
"text": {
|
|
6683
|
+
"tag": "lark_md",
|
|
6684
|
+
"content": "**🏢 Channel:**{{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}"
|
|
6685
|
+
}
|
|
6686
|
+
},
|
|
6687
|
+
{
|
|
6688
|
+
"text": {
|
|
6689
|
+
"tag": "lark_md",
|
|
6690
|
+
"content": "**{{if eq .IncidentSeverity "Critical"}}🔴{{else if eq .IncidentSeverity "Warning"}}⚠️{{else}}ℹ️{{end}} Severity:**{{.IncidentSeverity}}"
|
|
6691
|
+
}
|
|
6692
|
+
},
|
|
6693
|
+
{
|
|
6694
|
+
"text": {
|
|
6695
|
+
"tag": "lark_md",
|
|
6696
|
+
"content": "**⏰ Triggered at:**{{date "2006-01-02 15:04:05" .StartTime}}{{if gt .AlertCnt 1}}"
|
|
6697
|
+
}
|
|
6698
|
+
},
|
|
6699
|
+
{
|
|
6700
|
+
"text": {
|
|
6701
|
+
"tag": "lark_md",
|
|
6702
|
+
"content": "**🔔 Grouped alerts:**{{.AlertCnt}} {{end}}{{if .Labels.resource}}"
|
|
6703
|
+
}
|
|
6704
|
+
},
|
|
6705
|
+
{
|
|
6706
|
+
"tag": "div",
|
|
6707
|
+
"text": {
|
|
6708
|
+
"tag": "lark_md",
|
|
6709
|
+
"content": "**📌 Alert targets:**{{toHtml (joinAlertLabels . "resource" ",")}} {{end}}{{if .Description}}"
|
|
6710
|
+
}
|
|
6711
|
+
},
|
|
6712
|
+
{
|
|
6713
|
+
"tag": "div",
|
|
6714
|
+
"text": {
|
|
6715
|
+
"tag": "lark_md",
|
|
6716
|
+
"content": "**🔍 Description:**{{.Description}}{{end}}{{if gt (len .Responders) 0}}"
|
|
6717
|
+
}
|
|
6718
|
+
},
|
|
6719
|
+
{
|
|
6720
|
+
"tag": "div",
|
|
6721
|
+
"text": {
|
|
6722
|
+
"tag": "lark_md",
|
|
6723
|
+
"content": "**👨💻 Responders:**{{range .Responders}}@{{.PersonName}} {{end}}{{end}}"
|
|
6724
|
+
}
|
|
6725
|
+
}
|
|
6726
|
+
]
|
|
6727
|
+
},
|
|
6728
|
+
{
|
|
6729
|
+
"tag": "hr"
|
|
6730
|
+
},
|
|
6731
|
+
{
|
|
6732
|
+
"tag": "action",
|
|
6733
|
+
"actions": [{
|
|
6734
|
+
"tag": "button",
|
|
6735
|
+
"text": {
|
|
6736
|
+
"tag": "plain_text",
|
|
6737
|
+
"content": "Details"
|
|
6738
|
+
},
|
|
6739
|
+
"type": "primary",
|
|
6740
|
+
"url": "{{.DetailUrl}}"
|
|
6741
|
+
},
|
|
6742
|
+
{
|
|
6743
|
+
"tag": "button",
|
|
6744
|
+
"text": {
|
|
6745
|
+
"tag": "plain_text",
|
|
6746
|
+
"content": "Acknowledge"
|
|
6747
|
+
},
|
|
6748
|
+
"type": "primary",
|
|
6749
|
+
"url": "{{.DetailUrl}}?ack=1"
|
|
6750
|
+
}
|
|
6751
|
+
]
|
|
6752
|
+
}]
|
|
6753
|
+
}
|
|
6754
|
+
}
|
|
6755
|
+
\`\`\`
|
|
6756
|
+
|
|
6757
|
+
2. Rich Text
|
|
6758
|
+
msg_type is required, value should be post
|
|
6759
|
+
\`\`\`
|
|
6760
|
+
{
|
|
6761
|
+
"msg_type": "post",
|
|
6762
|
+
"post": {
|
|
6763
|
+
"zh_cn": {
|
|
6764
|
+
"title": "{{if eq .IncidentSeverity "Critical"}}🔴{{else if eq .IncidentSeverity "Warning"}}⚠️{{else}}ℹ️{{end}} {{fireReason .}}INC #{{.Num}} {{toHtml .Title}}",
|
|
6765
|
+
"content": [
|
|
6766
|
+
[{
|
|
6767
|
+
"tag": "text",
|
|
6768
|
+
"text": "🏢 "
|
|
6769
|
+
}, {
|
|
6770
|
+
"tag": "text",
|
|
6771
|
+
"text": "Channel:",
|
|
6772
|
+
"text_type": "bold"
|
|
6773
|
+
}, {
|
|
6774
|
+
"tag": "text",
|
|
6775
|
+
"text": "{{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}\\n"
|
|
6776
|
+
}],
|
|
6777
|
+
[{
|
|
6778
|
+
"tag": "text",
|
|
6779
|
+
"text": "{{if eq .IncidentSeverity "Critical"}}🔴{{else if eq .IncidentSeverity "Warning"}}⚠️{{else}}ℹ️{{end}} "
|
|
6780
|
+
}, {
|
|
6781
|
+
"tag": "text",
|
|
6782
|
+
"text": "Severity:",
|
|
6783
|
+
"text_type": "bold"
|
|
6784
|
+
}, {
|
|
6785
|
+
"tag": "text",
|
|
6786
|
+
"text": "{{.IncidentSeverity}}\\n",
|
|
6787
|
+
"text_type": "{{if eq .IncidentSeverity "Critical"}}bold{{end}}"
|
|
6788
|
+
}],
|
|
6789
|
+
[{
|
|
6790
|
+
"tag": "text",
|
|
6791
|
+
"text": "⏰ "
|
|
6792
|
+
}, {
|
|
6793
|
+
"tag": "text",
|
|
6794
|
+
"text": "Triggered at:",
|
|
6795
|
+
"text_type": "bold"
|
|
6796
|
+
}, {
|
|
6797
|
+
"tag": "text",
|
|
6798
|
+
"text": "{{date "2006-01-02 15:04:05" .StartTime}}\\n"
|
|
6799
|
+
}],
|
|
6800
|
+
{{if gt .AlertCnt 1}}[{
|
|
6801
|
+
"tag": "text",
|
|
6802
|
+
"text": "🔔 "
|
|
6803
|
+
}, {
|
|
6804
|
+
"tag": "text",
|
|
6805
|
+
"text": "Grouped alerts:",
|
|
6806
|
+
"text_type": "bold"
|
|
6807
|
+
}, {
|
|
6808
|
+
"tag": "text",
|
|
6809
|
+
"text": "{{.AlertCnt}}\\n"
|
|
6810
|
+
}],{{end}}
|
|
6811
|
+
{{if .Labels.resource}}[{
|
|
6812
|
+
"tag": "text",
|
|
6813
|
+
"text": "📋 "
|
|
6814
|
+
}, {
|
|
6815
|
+
"tag": "text",
|
|
6816
|
+
"text": "Alert targets:",
|
|
6817
|
+
"text_type": "bold"
|
|
6818
|
+
}, {
|
|
6819
|
+
"tag": "text",
|
|
6820
|
+
"text": "{{toHtml (joinAlertLabels . "resource" ", ")}}\\n"
|
|
6821
|
+
}],{{end}}
|
|
6822
|
+
{{if .Description}}[{
|
|
6823
|
+
"tag": "text",
|
|
6824
|
+
"text": "📝 "
|
|
6825
|
+
}, {
|
|
6826
|
+
"tag": "text",
|
|
6827
|
+
"text": "Description:",
|
|
6828
|
+
"text_type": "bold"
|
|
6829
|
+
}, {
|
|
6830
|
+
"tag": "text",
|
|
6831
|
+
"text": "{{toHtml .Description}}\\n"
|
|
6832
|
+
}],{{end}}
|
|
6833
|
+
{{if gt (len .Responders) 0}}[{
|
|
6834
|
+
"tag": "text",
|
|
6835
|
+
"text": "👨💻 "
|
|
6836
|
+
}, {
|
|
6837
|
+
"tag": "text",
|
|
6838
|
+
"text": "Responders:",
|
|
6839
|
+
"text_type": "bold"
|
|
6840
|
+
}, {
|
|
6841
|
+
"tag": "text",
|
|
6842
|
+
"text": "{{range .Responders}}@{{.PersonName}} {{end}}\\n"
|
|
6843
|
+
}],{{end}}
|
|
6844
|
+
[{
|
|
6845
|
+
"tag": "a",
|
|
6846
|
+
"href": "{{.DetailUrl}}",
|
|
6847
|
+
"text": "Details"
|
|
6848
|
+
},{
|
|
6849
|
+
"tag": "text",
|
|
6850
|
+
"text": " "
|
|
6851
|
+
},{
|
|
6852
|
+
"tag": "a",
|
|
6853
|
+
"href": "{{.DetailUrl}}?ack=1",
|
|
6854
|
+
"text": "Acknowledge"
|
|
6855
|
+
}]
|
|
6856
|
+
]
|
|
6857
|
+
}
|
|
6858
|
+
}
|
|
6859
|
+
}
|
|
6860
|
+
\`\`\`
|
|
6861
|
+
|
|
6862
|
+
3. Plain Text
|
|
6863
|
+
\`\`\`
|
|
6864
|
+
{{fireReason .}}INC #{{.Num}} {{toHtml .Title}}
|
|
6865
|
+
-----
|
|
6866
|
+
Channel:{{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}
|
|
6867
|
+
Severity:{{.IncidentSeverity}}
|
|
6868
|
+
Triggered at:{{date "2006-01-02 15:04:05" .StartTime}}
|
|
6869
|
+
Duration:{{ago .StartTime}}{{if gt .AlertCnt 1}}
|
|
6870
|
+
Grouped alerts:{{.AlertCnt}}{{end}}{{if .Labels.resource}}
|
|
6871
|
+
Alert targets:{{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}{{if .Description}}
|
|
6872
|
+
Description:{{toHtml .Description}}{{end}}{{if gt (len .Responders) 0}}
|
|
6873
|
+
Responders:{{range .Responders}}@{{.PersonName}} {{end}}{{end}}
|
|
6874
|
+
<br>Details:{{.DetailUrl}}
|
|
6875
|
+
\`\`\`
|
|
6876
|
+
</div>
|
|
6877
|
+
|
|
6878
|
+
<div class="dingtalk hide">
|
|
6879
|
+
|
|
6880
|
+
## Dingtalk Bot
|
|
6881
|
+
---
|
|
6882
|
+
Dingtalk bot only supports sending Markdown messages ([syntax restrictions](https://open.dingtalk.com/document/robots/custom-robot-access#title-7ur-3ok-s1a)).
|
|
6883
|
+
|
|
6884
|
+
- The maximum message length is \`4000 bytes, content exceeding this limit will be truncated\`
|
|
6885
|
+
- If the text contains \`<br>\`, when rendering, the system will \`first remove empty lines, then replace <br> with line breaks\`
|
|
6886
|
+
- If no custom content is set, the system default template will be used to display key information:
|
|
6887
|
+
|
|
6888
|
+
\`\`\`
|
|
6889
|
+
{{fireReason .}}INC [#{{.Num}}]({{.DetailUrl}}) {{toHtml .Title}}
|
|
6890
|
+
|
|
6891
|
+
---
|
|
6892
|
+
- Channel: {{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}
|
|
6893
|
+
- Severity: {{$s := colorSeverity .IncidentSeverity}}{{toHtml $s}}
|
|
6894
|
+
- Triggered at: {{date "2006-01-02 15:04:05" .StartTime}}
|
|
6895
|
+
- Duration: {{ago .StartTime}}{{if gt .AlertCnt 1}}
|
|
6896
|
+
- Grouped alerts: {{.AlertCnt}}{{end}}{{if .Labels.resource}}
|
|
6897
|
+
- Alert targets: {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}{{if .Description}}
|
|
6898
|
+
- Description: {{toHtml .Description}}{{end}}{{if gt (len .Responders) 0}}
|
|
6899
|
+
- Responders: {{range .Responders}}@{{.PersonName}} {{end}}{{end}}
|
|
6900
|
+
---
|
|
6901
|
+
<br>[Details]({{.DetailUrl}})|[Acknowledge]({{.DetailUrl}}?ack=1)
|
|
6902
|
+
\`\`\`
|
|
6903
|
+
</div>
|
|
6904
|
+
|
|
6905
|
+
<div class="wecom hide">
|
|
6906
|
+
|
|
6907
|
+
## WeCom Bot
|
|
6424
6908
|
---
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
-
|
|
6428
|
-
- If
|
|
6909
|
+
WeCom bot only supports sending Markdown messages ([syntax restrictions](https://developer.work.weixin.qq.com/document/path/91770#markdown%E7%B1%BB%E5%9E%8B)).
|
|
6910
|
+
|
|
6911
|
+
- The maximum message length is \`4000 bytes, content exceeding this limit will be truncated\`
|
|
6912
|
+
- If the text contains \`<br>\`, when rendering, the system will \`first remove empty lines, then replace <br> with line breaks\`
|
|
6913
|
+
- If no custom content is set, the system default template will be used to display key information:
|
|
6429
6914
|
|
|
6430
6915
|
\`\`\`
|
|
6916
|
+
{{fireReason .}}**INC [#{{.Num}}]({{.DetailUrl}}) {{toHtml .Title}}**
|
|
6917
|
+
> Channel: <font color="warning">{{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}</font>
|
|
6918
|
+
> Severity: <font color="warning">{{.IncidentSeverity}}</font>
|
|
6919
|
+
> Triggered at: {{date "2006-01-02 15:04:05" .StartTime}}
|
|
6920
|
+
> Duration: {{ago .StartTime}}{{if gt .AlertCnt 1}}
|
|
6921
|
+
> Grouped alerts: {{.AlertCnt}}{{end}}{{if .Labels.resource}}
|
|
6922
|
+
> Alert targets: {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}{{if .Description}}
|
|
6923
|
+
> Description: {{toHtml .Description}}{{end}}{{if gt (len .Responders) 0}}
|
|
6924
|
+
> Responders: {{range .Responders}}@{{.PersonName}} {{end}}{{end}}
|
|
6925
|
+
<br>[Details]({{.DetailUrl}})|[Acknowledge]({{.DetailUrl}}?ack=1)
|
|
6926
|
+
\`\`\`
|
|
6927
|
+
</div>
|
|
6928
|
+
|
|
6929
|
+
<div class="telegram hide">
|
|
6930
|
+
|
|
6931
|
+
## Telegram Bot
|
|
6932
|
+
---
|
|
6933
|
+
|
|
6934
|
+
- Configure a Telegram service address accessible in mainland China
|
|
6935
|
+
- The maximum message length is \`4096 characters, content exceeding this limit will not be sent\`
|
|
6936
|
+
- If the text contains \`<br>\`, when rendering, the system will \`first remove empty lines, then replace <br> with line breaks\`
|
|
6937
|
+
- If no custom content is set, the system default template will be used to display key information:
|
|
6938
|
+
|
|
6939
|
+
\`\`\`
|
|
6940
|
+
{{fireReason .}}INC [#{{.Num}}]({{.DetailUrl}}) {{toHtml .Title}}
|
|
6941
|
+
-----
|
|
6942
|
+
Channel: {{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}
|
|
6943
|
+
Severity: {{.IncidentSeverity}}
|
|
6944
|
+
Triggered at: {{date "2006-01-02 15:04:05" .StartTime}}
|
|
6945
|
+
Duration: {{ago .StartTime}}{{if gt .AlertCnt 1}}
|
|
6946
|
+
Grouped alerts: {{.AlertCnt}}{{end}}{{if .Labels.resource}}
|
|
6947
|
+
Alert targets: {{toHtml (joinAlertLabels . "resource" ", ")}}({{.Labels.resource}}){{end}}{{if .Description}}
|
|
6948
|
+
Description: {{toHtml .Description}}{{end}}{{if gt (len .Responders) 0}}
|
|
6949
|
+
Responders: {{range .Responders}}@{{.PersonName}} {{end}}{{end}}
|
|
6950
|
+
|
|
6951
|
+
<br>[Details]({{.DetailUrl}})|[Acknowledge]({{.DetailUrl}}?ack=1)
|
|
6952
|
+
\`\`\`
|
|
6953
|
+
</div>
|
|
6954
|
+
|
|
6955
|
+
<div class="slack hide">
|
|
6956
|
+
|
|
6957
|
+
## Slack Bot
|
|
6958
|
+
---
|
|
6959
|
+
- Messages can be \`approximately 15000 characters long, content exceeding this limit will be truncated\`
|
|
6960
|
+
- If the text contains \`<br>\`, when rendering, the system will \`first remove empty lines, then replace <br> with line breaks\`
|
|
6961
|
+
- If no custom content is set, the system default template will be used to display key information:
|
|
6962
|
+
|
|
6963
|
+
\`\`\`
|
|
6964
|
+
{{fireReason .}}INC <{{.DetailUrl}}|#{{.Num}}> {{toHtml .Title}}
|
|
6965
|
+
-----
|
|
6966
|
+
Channel: {{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}
|
|
6967
|
+
Severity: {{.IncidentSeverity}}
|
|
6968
|
+
Triggered at: {{date "2006-01-02 15:04:05" .StartTime}}
|
|
6969
|
+
Duration: {{ago .StartTime}}{{if gt .AlertCnt 1}}
|
|
6970
|
+
Grouped alerts: {{.AlertCnt}}{{end}}{{if .Labels.resource}}
|
|
6971
|
+
Alert targets: {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}{{if .Description}}
|
|
6972
|
+
Description: {{toHtml .Description}}{{end}}{{if gt (len .Responders) 0}}
|
|
6973
|
+
Responders: {{range .Responders}}@{{.PersonName}} {{end}}{{end}}
|
|
6974
|
+
-----
|
|
6975
|
+
<br><{{.DetailUrl}}|Details>|<{{.DetailUrl}}?ack=1|Acknowledge>
|
|
6976
|
+
\`\`\`
|
|
6977
|
+
</div>
|
|
6978
|
+
|
|
6979
|
+
<div class="zoom hide">
|
|
6980
|
+
|
|
6981
|
+
## Zoom Bot
|
|
6982
|
+
---
|
|
6983
|
+
- Messages can be \`approximately 4000 characters long, content exceeding this limit will be truncated\`
|
|
6984
|
+
- If the text contains \`<br>\`, when rendering, the system will \`first remove empty lines, then replace <br> with line breaks\`
|
|
6985
|
+
- Message format \`follows Zoom message format\`. The current bot application doesn't support Markdown. For other formats, please refer to the official documentation: https://developers.zoom.us/docs/team-chat-apps/customizing-messages/
|
|
6986
|
+
- If no custom content is set, the system default template will be used to display key information:
|
|
6987
|
+
|
|
6988
|
+
\`\`\`json
|
|
6431
6989
|
{"head": {
|
|
6432
6990
|
"text": "{{fireReason .}}INC [#{{.Num}}] {{toHtml .Title}}",
|
|
6433
6991
|
"style": {
|
|
@@ -6439,7 +6997,7 @@ If you want to display only key label information, you can refer to the code sni
|
|
|
6439
6997
|
"body": [
|
|
6440
6998
|
{
|
|
6441
6999
|
"type": "message",
|
|
6442
|
-
"text": "Channel
|
|
7000
|
+
"text": "Channel: {{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}",
|
|
6443
7001
|
"style": {
|
|
6444
7002
|
"bold": false,
|
|
6445
7003
|
"italic": false
|
|
@@ -6447,7 +7005,7 @@ If you want to display only key label information, you can refer to the code sni
|
|
|
6447
7005
|
},
|
|
6448
7006
|
{
|
|
6449
7007
|
"type": "message",
|
|
6450
|
-
"text": "Severity
|
|
7008
|
+
"text": "Severity: {{.IncidentSeverity}}",
|
|
6451
7009
|
"style": {
|
|
6452
7010
|
"bold": false,
|
|
6453
7011
|
"italic": false,
|
|
@@ -6456,7 +7014,7 @@ If you want to display only key label information, you can refer to the code sni
|
|
|
6456
7014
|
},
|
|
6457
7015
|
{
|
|
6458
7016
|
"type": "message",
|
|
6459
|
-
"text": "Duration
|
|
7017
|
+
"text": "Duration: {{ago .StartTime}}{{if gt .AlertCnt 1}}",
|
|
6460
7018
|
"style": {
|
|
6461
7019
|
"bold": false,
|
|
6462
7020
|
"italic": false
|
|
@@ -6464,7 +7022,7 @@ If you want to display only key label information, you can refer to the code sni
|
|
|
6464
7022
|
},
|
|
6465
7023
|
{
|
|
6466
7024
|
"type": "message",
|
|
6467
|
-
"text": "Grouped alerts
|
|
7025
|
+
"text": "Grouped alerts: {{.AlertCnt}}{{end}}{{if .Labels.resource}}",
|
|
6468
7026
|
"style": {
|
|
6469
7027
|
"bold": false,
|
|
6470
7028
|
"italic": false
|
|
@@ -6472,7 +7030,7 @@ If you want to display only key label information, you can refer to the code sni
|
|
|
6472
7030
|
},
|
|
6473
7031
|
{
|
|
6474
7032
|
"type": "message",
|
|
6475
|
-
"text": "
|
|
7033
|
+
"text": "Alert targets: {{.Labels.resource}}{{end}}{{if .Description}}",
|
|
6476
7034
|
"style": {
|
|
6477
7035
|
"bold": false,
|
|
6478
7036
|
"italic": false
|
|
@@ -6480,7 +7038,7 @@ If you want to display only key label information, you can refer to the code sni
|
|
|
6480
7038
|
},
|
|
6481
7039
|
{
|
|
6482
7040
|
"type": "message",
|
|
6483
|
-
"text": "Description
|
|
7041
|
+
"text": "Description: {{toHtml .Description}}{{end}}{{if gt (len .Responders) 0}}",
|
|
6484
7042
|
"style": {
|
|
6485
7043
|
"bold": false,
|
|
6486
7044
|
"italic": false
|
|
@@ -6488,7 +7046,7 @@ If you want to display only key label information, you can refer to the code sni
|
|
|
6488
7046
|
},
|
|
6489
7047
|
{
|
|
6490
7048
|
"type": "message",
|
|
6491
|
-
"text": "Responders
|
|
7049
|
+
"text": "Responders: {{range .Responders}}@{{.PersonName}}{{end}}{{end}}",
|
|
6492
7050
|
"style": {
|
|
6493
7051
|
"bold": false,
|
|
6494
7052
|
"italic": false
|
|
@@ -6496,12 +7054,12 @@ If you want to display only key label information, you can refer to the code sni
|
|
|
6496
7054
|
},
|
|
6497
7055
|
{
|
|
6498
7056
|
"type": "message",
|
|
6499
|
-
"text": "View
|
|
7057
|
+
"text": "View Details",
|
|
6500
7058
|
"link": "{{.DetailUrl}}{{if .IsFlapping}}"
|
|
6501
7059
|
},
|
|
6502
7060
|
{
|
|
6503
7061
|
"type": "message",
|
|
6504
|
-
"text": "Note:
|
|
7062
|
+
"text": "Note: The current incident status is changing frequently. Notifications will be suppressed for {{.Flapping.MuteMinutes}} minutes. Please optimize your alert policy.{{end}}{{if .IsInStorm}}",
|
|
6505
7063
|
"style": {
|
|
6506
7064
|
"bold": true,
|
|
6507
7065
|
"italic": false
|
|
@@ -6509,7 +7067,7 @@ If you want to display only key label information, you can refer to the code sni
|
|
|
6509
7067
|
},
|
|
6510
7068
|
{
|
|
6511
7069
|
"type": "message",
|
|
6512
|
-
"text": "Note:
|
|
7070
|
+
"text": "Note: The current incident has grouped {{.AlertCnt}} alerts, triggering an alert storm. Please handle with urgency!{{end}}",
|
|
6513
7071
|
"style": {
|
|
6514
7072
|
"bold": true,
|
|
6515
7073
|
"italic": false
|
|
@@ -6518,105 +7076,112 @@ If you want to display only key label information, you can refer to the code sni
|
|
|
6518
7076
|
]
|
|
6519
7077
|
}
|
|
6520
7078
|
\`\`\`
|
|
7079
|
+
</div>
|
|
7080
|
+
|
|
7081
|
+
<div class="sms hide">
|
|
6521
7082
|
|
|
6522
7083
|
## SMS
|
|
6523
7084
|
---
|
|
6524
|
-
If custom content is
|
|
7085
|
+
If no custom content is set, the system default template will be used for notifications:
|
|
6525
7086
|
|
|
6526
|
-
\`\`\`
|
|
7087
|
+
\`\`\`go
|
|
6527
7088
|
You have a pending incident: {{toHtml .Title}}, Channel: {{.ChannelName}}, Severity: {{.IncidentSeverity}}{{if gt .AlertCnt 1}}, Grouped {{.AlertCnt}} alerts{{end}}
|
|
6528
7089
|
\`\`\`
|
|
7090
|
+
</div>
|
|
7091
|
+
|
|
7092
|
+
<div class="email hide">
|
|
6529
7093
|
|
|
6530
7094
|
## Email
|
|
6531
7095
|
---
|
|
6532
|
-
If custom content is
|
|
7096
|
+
If no custom content is set, the system default template will be used for notifications:
|
|
6533
7097
|
|
|
6534
|
-
\`\`\`
|
|
7098
|
+
\`\`\`html
|
|
6535
7099
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
6536
7100
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
6537
7101
|
<title>{{.Title}}</title>
|
|
6538
7102
|
<html lang="en">
|
|
6539
7103
|
|
|
6540
7104
|
<head data-id="__react-email-head">
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
7105
|
+
<style>
|
|
7106
|
+
.bg-Critical { background-color: #C80000; }
|
|
7107
|
+
.bg-Warning { background-color: #FA7D00; }
|
|
7108
|
+
.bg-Info { background-color: #FABE00; }
|
|
7109
|
+
.bg-Ok { background-color: rgb(132 204 22); }
|
|
7110
|
+
.text-Critical { color: #C80000; }
|
|
7111
|
+
.text-Warning { color: #FA7D00; }
|
|
7112
|
+
.text-Info { color: #FABE00; }
|
|
7113
|
+
.text-Ok { color: rgb(132 204 22); }
|
|
7114
|
+
.text-title {font-weight:500;width:6rem;flex-shrink:0}
|
|
7115
|
+
.text-content {color:rgb(55,65,81)}
|
|
7116
|
+
</style>
|
|
6553
7117
|
</head>
|
|
6554
7118
|
|
|
6555
7119
|
<body data-id="__react-email-body" style="background-color:rgb(255,255,255);border-radius:0.25rem;margin-top:2.5rem;margin-bottom:2.5rem;margin-left:auto;margin-right:auto;padding:1rem;min-width:400px;max-width:660px;font-family:ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji">
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
7120
|
+
<div style="width:100%;height:0.375rem;margin-bottom:2rem" class="bg-{{.IncidentSeverity}}"></div>
|
|
7121
|
+
<div style="display:flex;align-items:center;margin-bottom:1.5rem">
|
|
7122
|
+
<div style="display:flex;align-items:flex-end;gap:1rem"><img witdh="120" data-id="react-email-img" src="https://console.flashcat.cloud/image/saas-logo.png" height="40" style="display:block;outline:none;border:none;text-decoration:none" /><span style="font-size:1.25rem;line-height:1.75rem;font-weight:600">You have a pending incident</span></div>
|
|
7123
|
+
</div>
|
|
7124
|
+
<div style="background-color:rgb(243,244,246);padding:2rem;margin-top:1rem;border-radius:0.5rem">
|
|
7125
|
+
<div style="display:flex;flex-direction:column;gap:0.75rem">
|
|
7126
|
+
<div style="display:flex">
|
|
7127
|
+
<div class="text-title">Title</div>
|
|
7128
|
+
<div class="text-content">{{.Title}}</div>
|
|
7129
|
+
</div>
|
|
7130
|
+
<div style="display:flex">
|
|
7131
|
+
<div class="text-title">Severity</div>
|
|
7132
|
+
<div class="text-{{.IncidentSeverity}}">{{.IncidentSeverity}}</div>
|
|
7133
|
+
</div>
|
|
7134
|
+
<div style="display:flex">
|
|
7135
|
+
<div class="text-title">Channel</div>
|
|
7136
|
+
<div class="text-content">{{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}</div>
|
|
7137
|
+
</div>
|
|
7138
|
+
<div style="display:flex">
|
|
7139
|
+
<div class="text-title">Triggered at</div>
|
|
7140
|
+
<div class="text-content">{{date "2006-01-02 15:04:05" .StartTime}}</div>
|
|
7141
|
+
</div>
|
|
7142
|
+
{{if .CreatorID}}
|
|
7143
|
+
<div style="display:flex">
|
|
7144
|
+
<div class="text-title">Creator</div>
|
|
7145
|
+
<div class="text-content">{{.Creator.PersonName}}</div>
|
|
7146
|
+
</div>
|
|
7147
|
+
{{end}}
|
|
7148
|
+
{{if gt (len .Responders) 0}}
|
|
7149
|
+
<div style="display:flex">
|
|
7150
|
+
<div class="text-title">Responders</div>
|
|
7151
|
+
<div class="text-content">{{range .Responders}}@{{.PersonName}} {{end}}</div>
|
|
7152
|
+
</div>
|
|
7153
|
+
{{end}}
|
|
7154
|
+
<div style="display:flex">
|
|
7155
|
+
<div class="text-title">Progress</div>
|
|
7156
|
+
<div class="text-content">{{.Progress}}</div>
|
|
7157
|
+
</div>
|
|
7158
|
+
<div style="display:flex">
|
|
7159
|
+
<div class="text-title">Description</div>
|
|
7160
|
+
<div style="color:rgb(55,65,81);margin-top:0.125rem">
|
|
7161
|
+
<div data-id="react-email-markdown">{{toHtml .Description}}</div>
|
|
7162
|
+
</div>
|
|
7163
|
+
</div>
|
|
7164
|
+
{{if .Labels.resource}}
|
|
7165
|
+
<div style="display:flex;margin-bottom:0.5rem;">
|
|
7166
|
+
<div style="color:#000;font-weight:500;width:6rem;margin-right:1rem;">Alert targets</div>
|
|
7167
|
+
<div style="color:rgb(55,65,81);margin-top:0.125rem">
|
|
7168
|
+
<div data-id="react-email-markdown">{{toHtml (joinAlertLabels . "resource" ", ")}}</div>
|
|
7169
|
+
</div>
|
|
7170
|
+
</div>
|
|
7171
|
+
{{end}}
|
|
7172
|
+
</div>
|
|
7173
|
+
<div style="display:flex;gap:1rem;margin-top:2rem"><a href="{{.DetailUrl}}?ack=1" data-id="react-email-button" target="_blank" style="line-height:100%;text-decoration:none;display:inline-block;max-width:100%;padding:0px 0px"><span></span><span style="max-width:100%;display:inline-block;line-height:120%;mso-padding-alt:0px;mso-text-raise:0"><div style="padding-left:2rem;padding-right:2rem;padding-top:0.5rem;padding-bottom:0.5rem;background-color:rgb(108,83,177);border-radius:0.25rem;font-size:1rem;line-height:1.5rem;color:rgb(255,255,255);font-weight:600;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms">Acknowledge</div></span><span></span></a><a href="{{.DetailUrl}}" data-id="react-email-button" target="_blank" style="color:#61dafb;line-height:100%;text-decoration:none;display:inline-block;max-width:100%;padding:0px 0px"><span></span><span style="max-width:100%;display:inline-block;line-height:120%;mso-padding-alt:0px;mso-text-raise:0"><div style="padding-left:2rem;padding-right:2rem;padding-top:0.5rem;padding-bottom:0.5rem;background-color:rgb(255,255,255);border-width: 1px;border-style:solid;border-color:rgb(229,231,235);border-radius:0.25rem;font-size:1rem;line-height:1.5rem;color:rgb(0,0,0);font-weight:600">View Details</div></span><span></span></a></div>
|
|
7174
|
+
</div>
|
|
7175
|
+
<div style="display:flex;justify-content:flex-end;align-items:flex-end;margin-top:2rem">
|
|
7176
|
+
<div style="font-size:0.875rem;line-height:1.25rem;font-weight:500">ALL RIGHTS RESERVED © Beijing Flashcat Cloud Technology Co.,Ltd.</div>
|
|
7177
|
+
</div>
|
|
6614
7178
|
</body>
|
|
6615
7179
|
|
|
6616
7180
|
</html>
|
|
6617
7181
|
\`\`\`
|
|
6618
7182
|
|
|
6619
|
-
As shown below:
|
|
6620
|
-
|
|
7183
|
+
As shown in the image below:
|
|
7184
|
+
|
|
7185
|
+
<img src="https://download.flashcat.cloud/flashduty/changelog/20230720/email_render.png" alt="drawing" style="display: block; margin: 0 auto;" width="500"/>
|
|
6621
7186
|
|
|
6622
|
-
|
|
7187
|
+
</div>`,ne={CustomAlert:n,Email:t,N9e:a,Prometheus:i,Grafana:o,Zabbix:s,UptimeKuma:r,AliyunARMS:l,AliyunCmEvent:d,AliyunCm:c,AliyunSLS:e,AWSCW:e,AzureMonitor:h,BaiDuBCM:u,HuaWeiCES:g,InfluxDB:p,OpenFalcon:m,PagerDuty:f,TencentBK:y,TencentCLS:v,TencentCm:b,TencentEb:w,OceanBase:C,Graylog:k,Skywalking:I,Sentry:S,Jiankongbao:A,AWSEventBridge:x,Dynatrace:L,HuaweiyunLTS:_,GoogleCM:F,Zilliz:Y,Splunk:R,AppDynamics:T,SolarWinds:U,VolcEngineMetric:D,VolcEngineEvent:E,VolcEngineTLS:N,OpManager:P,Meraki:M,StateCloud:W,Guance:G,CustomChange:O,Jira:H,Lark:$,Dingtalk:B,Wecom:z,Slack:V,MicrosoftTeams:J,AlertWebhook:K,IncidentWebhook:Z,CustomAction:Q,Templates:ee,HuaweiyunAPM:q,JiraSync:X,ZStack:j};module.exports=ne;
|