Skip to content

Commit aa36c13

Browse files
author
niuweili
committed
t Merge branch 'f-servicenow' into test
2 parents 6de2485 + 375c436 commit aa36c13

21 files changed

Lines changed: 1813 additions & 518 deletions

File tree

flashduty/en/0. Overview/1. Introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Flashduty is not Nightingale. As an open-source monitoring tool primarily contri
2020
### On-call
2121
An intelligent on-call and alert collaboration platform supporting flexible on-call scheduling, automatic dispatching and escalation, and multi-channel notifications to ensure critical alerts are not missed. Integrated with automated workflows to improve team response efficiency.
2222

23-
You can learn more at [On-call](https://docs.flashcat.cloud/en/flashduty/on-call/introduction?nav=flashduty).
23+
You can learn more at [On-call](https://docs.flashcat.cloud/en/flashduty/getting-started).
2424

2525
### Monitors (Beta)
2626
Multi-source monitoring and alerting engine supporting alert detection on data from various sources such as Prometheus, Elasticsearch, Clickhouse, and more.

flashduty/en/1. On-call/1. Getting Started/1.4 Product Comparison.md

Lines changed: 204 additions & 112 deletions
Large diffs are not rendered by default.

flashduty/en/1. On-call/4. Configure On-call/4.13 Notification Bots.md

Lines changed: 281 additions & 133 deletions
Large diffs are not rendered by default.

flashduty/en/1. On-call/8. Integrations/8.3 IM integration/8.3.2 Dingtalk Integration Guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ After the application is released, you can access it via mobile/PC client. First
141141
- Return to the escalation rule configuration page, refresh and reselect the group chat list
142142
- If still unable to get the group chat list, try uninstalling the Cool App from the group and repeat the above steps. If it still doesn't work, please contact customer or dedicated technical support
143143

144-
<img src="https://download.flashcat.cloud/flashduty/doc/en/ding/ding-18.png" alt="drawing" width="500"/>
144+
<img src="https://download.flashcat.cloud/flashduty/doc/en/dingtalk-install-1.png" alt="drawing" width="500"/>
145145

146-
<img src="https://download.flashcat.cloud/flashduty/doc/en/ding/ding-19.png" alt="drawing" width="500"/>
146+
<img src="https://download.flashcat.cloud/flashduty/doc/en/dingtalk-install-2.png" alt="drawing" width="500"/>
147147

148148
4. **Dingtalk Custom Application API Call Limits:** [Dingtalk Documentation](https://open.dingtalk.com/document/orgapp/descriptions-about-adjusting-limit-and-frequency-of-api-calls?spm=ding_open_doc.document.0.0.6f6b21d9WtkxJI)
149149

Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
---
2+
title: "ServiceNow Sync"
3+
description: "Sync incidents with ServiceNow Incidents through ServiceNow sync webhook."
4+
date: "2025-05-19T10:00:00+08:00"
5+
url: "https://docs.flashcat.cloud/en/flashduty/service-now-sync"
6+
---
7+
8+
Through ServiceNow sync webhook, Flashduty incidents are associated and synchronized with ServiceNow Incidents to achieve integration between Flashduty and ServiceNow.
9+
10+
## In ServiceNow
11+
12+
### Create User
13+
14+
1. Log in to the ServiceNow instance console, select `ALL`, enter `USERS` and select `Organization`-`Users`.
15+
2. Click `New` to create a new user.
16+
3. In the edit page, enter `flashduty` in the `User ID` field.
17+
4. Keep `Password needs reset`, `Web service access only`, and `Internal Integration User` unchecked.
18+
5. Submit and save.
19+
20+
<img alt="drawing" width="600" src="https://download.flashcat.cloud/flashduty/doc/snow/snow-1.png" />
21+
22+
### Configure User
23+
The user used to access ServiceNow needs to have administrator roles.
24+
1. On the user list page, find the newly created `flashduty` user and go to the configuration page.
25+
2. In the edit page, click `Set Password` to set a password.
26+
3. Click `Roles` to add **admin and itil** roles.
27+
4. Click `Update` to update the configuration.
28+
29+
<img alt="drawing" width="600" src="https://download.flashcat.cloud/flashduty/doc/snow/snow-2.png" />
30+
31+
32+
33+
## In Flashduty
34+
35+
### Configure Integration
36+
37+
Enter the username/password and instance name configured above into the integration information on the left and click Next to configure.
38+
39+
- **Integration Name:** Define a name for the current integration.
40+
- **Management Team:** When a management team is selected, only team members and tenant administrators can edit this integration.
41+
- **Channel:** Select the channel where this integration takes effect.
42+
- **Sync Direction:**
43+
- To_ServiceNow: Sync Flashduty incidents to ServiceNow.
44+
- From_ServiceNow: Sync ServiceNow Incidents to Flashduty.
45+
- Two-way: Bidirectional sync between Flashduty and ServiceNow.
46+
- **Trigger Mode**:
47+
- Auto Trigger: Requires configuration of corresponding conditions, Flashduty will automatically sync incidents that meet the conditions to ServiceNow.
48+
- Manual Trigger: Requires manual triggering of ServiceNow sync in the More Actions section of the incident details page (the integration configuration name is the trigger name).
49+
- **Severity Mapping:** ServiceNow's Priority is determined by the combined values of Impact and Urgency, so you can refer to ServiceNow's `Priority Lookup Rules` for configuration. Additionally, note that only when ServiceNow Incident's Urgency changes will it trigger updates to Flashduty incident severity.
50+
- **Custom Field Mapping:** You can choose to sync certain labels or all labels of incidents as well as custom field content to ServiceNow fields (only text-type fields are supported).
51+
52+
## In ServiceNow
53+
54+
When sync direction is set to From_ServiceNow or Two-way, additional configuration is required in ServiceNow to sync ServiceNow Incidents to Flashduty. When syncing to Flashduty, there are two methods available, choose based on your actual needs.
55+
56+
### Manual Sync
57+
58+
This method relies on ServiceNow's UI Action and Script Include configuration. The effect achieved by following the steps below: When creating or updating an Incident, you can see a button to send sync requests in the function area. Triggering this button will sync the current Incident content to Flashduty. Note that if the request fails when triggered, please retry (retry interval should be greater than 10 seconds).
59+
60+
#### Configure UI Action
61+
62+
1. Log in to the ServiceNow instance console, select `ALL`, enter `UI Actions` and select `System Definition`-`UI Actions`.
63+
2. Click `New` to create a new Action.
64+
3. Enter **Send To Flashduty** in `Name`, select **Incident** in `Table`.
65+
4. Keep `Form button`, `Active`, `Show insert`, `Show update`, `Client`, `List v2/3 Compatible` checked.
66+
5. Enter **onClick();** in `Onclick`.
67+
6. Enter the following in `Script`:
68+
69+
```
70+
function onClick() {
71+
g_form.save();
72+
73+
var ga = new GlideAjax('IncidentWebhookHelperAjax');
74+
ga.addParam('sysparm_name', 'sendWebhook');
75+
ga.addParam('sysparm_sys_id', g_form.getUniqueValue());
76+
77+
ga.getXMLAnswer(function(response) {
78+
alert('Webhook Triggered: ' + response);
79+
});
80+
}
81+
82+
```
83+
84+
7. Submit and save.
85+
86+
#### Configure Script Include
87+
88+
1. Log in to the ServiceNow instance console, select `ALL`, enter `Script Includes` and select `System Definition`-`Script Includes`.
89+
2. Click `New` to create a new Script Include.
90+
3. Enter **IncidentWebhookHelper** in `Name`, select **All application scopes** in `Accessible from`.
91+
4. Keep `Client callable` and `Active` checked.
92+
5. Enter the following content in `Script`, where you need to add the integration push URL in **request.setEndpoint**:
93+
94+
<div class="hide">
95+
96+
Note: The body configures default receiving fields. If you have custom fields that need to be synced to Flashduty, you need to manually add content to the body. For example, if you want to add a field named: test_001 (this field name can be obtained when adding custom fields in the integration configuration, do not use the field name displayed in the ServiceNow Incident form), then you need to add to the body: test_001: current.getDisplayValue("test_001").
97+
98+
</div>
99+
```
100+
var IncidentWebhookHelper = Class.create();
101+
IncidentWebhookHelper.prototype = {
102+
initialize: function() {},
103+
104+
sendIncidentWebhook: function(current) {
105+
function getLastComment(sysId) {
106+
var journalGR = new GlideRecord('sys_journal_field');
107+
journalGR.addQuery('element_id', sysId);
108+
journalGR.addQuery('element', 'comments');
109+
journalGR.orderByDesc('sys_created_on');
110+
journalGR.setLimit(1);
111+
journalGR.query();
112+
if (journalGR.next()) {
113+
return journalGR.getValue('value');
114+
}
115+
return '';
116+
}
117+
118+
var body = {
119+
action_type: current.isNewRecord() ? 'insert' : 'update',
120+
number: current.getValue("number"),
121+
sys_id: current.getUniqueValue(),
122+
short_description: current.getValue("short_description"),
123+
description: current.getValue("description"),
124+
state: current.getDisplayValue("state"),
125+
impact: current.getDisplayValue("impact"),
126+
urgency: current.getDisplayValue("urgency"),
127+
comments: getLastComment(current.getUniqueValue())
128+
};
129+
130+
try {
131+
var request = new sn_ws.RESTMessageV2();
132+
request.setHttpMethod("POST");
133+
request.setEndpoint("PUSH URL");
134+
request.setRequestHeader("Content-Type", "application/json");
135+
request.setRequestBody(JSON.stringify(body));
136+
request.executeAsync();
137+
} catch (ex) {
138+
gs.error("Webhook Call failed: " + ex.message);
139+
}
140+
},
141+
142+
type: 'IncidentWebhookHelper'
143+
};
144+
145+
```
146+
147+
6. Submit and save.
148+
7. Return to the Script Includes list and continue creating.
149+
8. Click `New` to create a new Script Include.
150+
9. Enter **IncidentWebhookHelperAjax** in `Name`, select **All application scopes** in `Accessible from`.
151+
10. Keep `Client callable` and `Active` checked.
152+
11. Enter the following content in `Script`:
153+
154+
```
155+
var IncidentWebhookHelperAjax = Class.create();
156+
IncidentWebhookHelperAjax.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
157+
sendWebhook: function() {
158+
var sysId = this.getParameter('sysparm_sys_id');
159+
var gr = new GlideRecord('incident');
160+
if (gr.get(sysId)) {
161+
var helper = new IncidentWebhookHelper();
162+
helper.sendIncidentWebhook(gr);
163+
return 'Success';
164+
}
165+
return 'Request failed';
166+
}
167+
});
168+
```
169+
170+
12. Submit and save.
171+
172+
### Auto Sync
173+
This method relies on ServiceNow's Business Rules configuration. Using this method, you can automatically sync Incidents to Flashduty when there are new or update events.
174+
175+
#### Configure Business Rules
176+
177+
1. Log in to the ServiceNow instance console, select `ALL`, enter `Business Rules` and select `System Definition`-`Business Rules`.
178+
2. Click `New` to create a new Business Rule.
179+
3. Enter **Send To Flashduty** in `Name`, select **Incident** in `Table`.
180+
4. Keep `Advanced` and `Active` checked.
181+
5. In the `When to run` section, select **async** in `When`, keep `Insert` and `Upsert` checked, configure others as needed.
182+
6. In the `Advanced` section, enter the following content in `Script`, where you need to add the integration push URL in **endpoint**:
183+
184+
<div class="hide">
185+
186+
Note: The body configures default receiving fields. If you have custom fields that need to be synced to Flashduty, you need to manually add content to the body. For example, if you want to add a field named: test_001 (this field name can be obtained when adding custom fields in the integration configuration, do not use the field name displayed in the ServiceNow Incident form), then you need to add to the body: test_001: current.getDisplayValue("test_001").
187+
188+
</div>
189+
190+
```
191+
(function executeRule(current, previous) {
192+
function getLastComment(recordSysId) {
193+
var journalGR = new GlideRecord('sys_journal_field');
194+
journalGR.addQuery('element_id', recordSysId);
195+
journalGR.addQuery('element', 'comments');
196+
journalGR.orderByDesc('sys_created_on');
197+
journalGR.setLimit(1);
198+
journalGR.query();
199+
if (journalGR.next()) {
200+
var comment = journalGR.getValue('value');
201+
return comment;
202+
}
203+
204+
return '';
205+
}
206+
207+
var operation = current.operation() || 'unknown';
208+
var isPreviousNull = previous === null;
209+
var createdOn = current.getValue('sys_created_on');
210+
var updatedOn = current.getValue('sys_updated_on');
211+
var isNewRecord = createdOn === updatedOn;
212+
213+
var action = 'update';
214+
if (isPreviousNull && isNewRecord) {
215+
action = 'insert';
216+
}
217+
218+
var body = {
219+
action_type: action,
220+
number: current.getValue("number"),
221+
sys_id: current.getUniqueValue(),
222+
short_description: current.getValue("short_description"),
223+
description: current.getValue("description"),
224+
state: current.getDisplayValue("state"),
225+
impact: current.getDisplayValue("impact"),
226+
urgency: current.getDisplayValue("urgency"),
227+
comments: getLastComment(current.getUniqueValue())
228+
};
229+
230+
try {
231+
var endpoint = '';
232+
var request = new sn_ws.RESTMessageV2();
233+
request.setHttpMethod("POST");
234+
request.setEndpoint(endpoint);
235+
request.setRequestHeader("Content-Type", "application/json");
236+
request.setRequestBody(JSON.stringify(body));
237+
request.executeAsync();
238+
} catch (ex) {
239+
gs.error("Error sending webhook: " + ex.message);
240+
}
241+
242+
})(current, previous);
243+
244+
```
245+
7. Submit and save.
246+
247+
## Sync Information
248+
249+
### Form Fields
250+
| ServiceNow | Flashduty | Notes |
251+
| ---------- | -------- | ---- |
252+
| Short_description | Title | |
253+
| Description | Description | |
254+
| Additional comments | Comments | |
255+
| State | Progress | |
256+
| Urgency | Severity | |
257+
| Others | Custom Fields | |
258+
259+
### Status Mapping
260+
261+
| ServiceNow | Flashduty | Notes |
262+
| ---------- | -------- | ---- |
263+
| New | Trigger | |
264+
| In Progress | Processing | |
265+
| On Hold | Snoozed | Default snooze 2 hours |
266+
| Resolved | CLosed | |
267+
| Closed | CLosed | |
268+
| Canceled | CLosed | |
269+
270+
271+
### Priority Mapping
272+
Only when ServiceNow's Urgency value changes will it affect Flashduty's Severity
273+
274+
| ServiceNow | Flashduty | Notes |
275+
| ---------- | -------- | ---- |
276+
| Low | Info | |
277+
| Medium | Warning | |
278+
| High | Critical | |

flashduty/en/2. RUM/2. Applications/4. Analysis Dashboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The overview module focuses on the core metrics of your application across multi
3131
The performance analysis module focuses on full-chain monitoring of application loading and interaction experience, including:
3232

3333
- **Page Performance**: Monitor trends and sample distribution of core page loading metrics such as FCP, LCP, CLS, and FCP.
34-
- **Long Tasks**: Events that block the browser's main thread for more than 50 milliseconds.
34+
- **Long Tasks**: A [long animation frame](https://developer.chrome.com/docs/web-platform/long-animation-frames#long-frames-api) is when a rendering update is delayed beyond 50 milliseconds.
3535
- **XHR and Fetch Requests**: Analyze the loading performance of XHR and Fetch interfaces to locate slow interfaces.
3636
- **Static Resources**: Analyze the loading time of static resources to identify performance bottlenecks during application loading.
3737

flashduty/en/2. RUM/3. Performance Monitoring/2. Metrics.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ In addition to core metrics, it also supports other auxiliary metrics:
2525

2626
These metrics are automatically collected when users visit pages and reported to the Flashduty platform through the SDK. You can view detailed performance data in the analysis dashboard.
2727

28+
:::tip
29+
Interaction to Next Paint and Largest Contentful Paint are not collected for pages opened in the background (for example, in a new tab or a window without focus).
30+
:::
31+
2832
## Metric Calculation Methods
2933

3034
### 1. Largest Contentful Paint (LCP)
@@ -53,6 +57,18 @@ These metrics are automatically collected when users visit pages and reported to
5357
- **Use case**: Optimize response speed for interaction-intensive pages (such as forms, navigation menus).
5458

5559

60+
## Monitoring Single Page Applications (SPA)
61+
62+
For Single Page Applications (SPA), the RUM browser SDK distinguishes between two navigation types through the `loading_type` attribute: `initial_load` and `route_change`.
63+
64+
1. History Single Page Applications
65+
If an interaction on a webpage causes the URL to change but the page does not refresh completely, the RUM SDK will start a new `view` using `loading_type:route_change`. RUM uses the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History) to track URL changes.
66+
67+
2. Hash Single Page Applications
68+
The RUM SDK automatically monitors frameworks that rely on hash (`#`) navigation. The SDK listens for `HashChangeEvent` and issues a new `view`. Events from HTML anchors that do not affect the current view context are ignored.
69+
70+
For SPA applications, if you need to monitor performance after route changes, it is recommended to use the [Custom Performance Monitoring](#Custom%20Performance%20Monitoring) feature to measure performance metrics of specific components or interactions.
71+
5672
## Custom Performance Monitoring
5773

5874
### 1. Component-level Performance Measurement
@@ -122,13 +138,7 @@ document.addEventListener("scroll", function handler() {
122138
- Use descriptive naming (such as `login_form_render`).
123139
- Maintain naming consistency.
124140

125-
### 2. SPA Scenario Handling
126-
127-
- When route changes, timing is based on the start time of the current RUM view.
128-
- Some timers need to be reset.
129-
- Pay attention to metric continuity during page transitions.
130-
131-
### 3. Performance Impact Control
141+
### 2. Performance Impact Control
132142

133143
- Control the number of custom metrics.
134144
- Avoid frequent timing.
@@ -154,6 +164,15 @@ document.addEventListener("scroll", function handler() {
154164
- Ensure timers are started and stopped correctly.
155165
- Check timestamp accuracy in asynchronous scenarios.
156166

167+
### 4. Empty Web Vitals Metrics Collection
168+
169+
- **Background pages**: Pages opened in new tabs or unfocused windows, causing INP and LCP to be uncollectable
170+
- **SPA route changes**: During `loading_type:route_change`, Core Web Vitals metrics (LCP, CLS, INP, FCP) will not be re-collected
171+
- **Integration method**: Page loads completely before SDK is fully initialized
172+
- **Page lifecycle**: Page is closed or navigated away before metrics collection is complete
173+
- **Browser compatibility**: Older browser versions do not support certain Web Vitals APIs
174+
- **Empty page content**: Page has no measurable content elements (such as blank pages)
175+
157176
## Next Steps
158177

159178
- [Performance Analysis](https://docs.flashcat.cloud/en/flashduty/rum/performance-analysis?nav=01JCQ7A4N4WRWNXW8EWEHXCMF5)

flashduty/en/2. RUM/4. Error Tracking/4. Source Mapping.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ Flashduty CLI provides the `sourcemaps` command for uploading `sourcemap` files
4949
Ensure Node.js is installed, then install `flashcat-cli` via npm:
5050

5151
```bash
52-
npm install -g @flashcat/flashcat-cli
52+
npm install -g @flashcloud/flashcat-cli
5353
```
5454

5555
2. **Configure API Key and Service Information**
56-
![2025-05-15-17-34-06](https://docs-cdn.flashcat.cloud/imges/png/026bb83be5f7ba043118e877f6bc2a82.png)
56+
![2025-06-24-17-20-59](https://docs-cdn.flashcat.cloud/imges/png/03c8b8922e101dc0b14cfdf60d3e08cf.png)
5757
In the **Application Management - Source Management** menu, click the "Upload Source" panel, fill in the following information, and generate an upload script:
5858

5959
- **API Key**: Used to authenticate your identity (e.g., `test2`).
@@ -178,4 +178,4 @@ Flashduty RUM (Real User Monitoring) integrates `sourcemap` functionality, suppo
178178
## Next Steps
179179

180180
- [Error Grouping](https://docs.flashcat.cloud/en/flashduty/rum/error-grouping?nav=01JCQ7A4N4WRWNXW8EWEHXCMF5)
181-
- [Issue Status](https://docs.flashcat.cloud/en/flashduty/rum/issue-states?nav=01JCQ7A4N4WRWNXW8EWEHXCMF5)
181+
- [Issue Status](https://docs.flashcat.cloud/en/flashduty/rum/issue-states?nav=01JCQ7A4N4WRWNXW8EWEHXCMF5)

flashduty/zh/0. 概览/1. 简介.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Flashduty 不是夜莺(Nightingale)。夜莺作为 Flashcat 主要贡献的
2020
### On-call
2121
智能值班与告警协作平台,支持灵活的值班调度、自动分派与升级、全渠道通知,保障关键告警不被遗漏。集成自动化工作流,提升团队响应效率。
2222

23-
您可前往[On-call](https://docs.flashcat.cloud/zh/flashduty/on-call/introduction)了解更多。
23+
您可前往[On-call](https://docs.flashcat.cloud/zh/flashduty/getting-started)了解更多。
2424

2525
### Monitors (Beta)
2626
多源监控与告警引擎,支持对Prometheus、Elasticsearch、Clickhouse等各种来源数据进行告警判断。

0 commit comments

Comments
 (0)