Skip to content

Commit df21d8e

Browse files
AB#180415: Change heading levels in Application Insights JavaScript SDK troubleshooting article (#4849)
* Demoted the Symptoms and Cause X sections. A few other edits. * A few minor changes. * Update javascript-sdk-troubleshooting.md --------- Co-authored-by: Jerry Sitser <[email protected]>
1 parent e2834bb commit df21d8e

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

support/azure/azure-monitor/app-insights/javascript-sdk-troubleshooting.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Troubleshoot issues that involve the App Insights JavaScript SDK
33
description: Learn how to troubleshoot SDK load failure for JavaScript web applications, Azure Application Insights for web pages, and source map support for JavaScript apps.
4-
ms.date: 06/07/2023
4+
ms.date: 08/31/2023
55
editor: v-jsitser
66
ms.service: azure-monitor
77
ms.subservice: application-insights
@@ -12,7 +12,7 @@ ms.reviewer: mmcc, toddfous, aaronmax, v-leedennis
1212

1313
# Application Insights JavaScript SDK troubleshooting
1414

15-
This article discusses how to troubleshoot various issues that involve the [Application Insights JavaScript SDK](https://github.com/Microsoft/ApplicationInsights-JS). The subjects in this article include SDK load failure for JavaScript web apps, App Insights for web pages, and source map support for JavaScript apps.
15+
This article discusses how to troubleshoot various issues that involve the [Application Insights JavaScript SDK](https://github.com/Microsoft/ApplicationInsights-JS). The subjects in this article include SDK load failure for JavaScript web apps and source map support for JavaScript apps.
1616

1717
<!--
1818
Editor's Note: This link name above "SDK Load Failure" has a direct references by https://go.microsoft.com/fwlink/?linkid=2128109 which is embedded in the snippet and from the JavaScript Page. If you change this text you MUST also update these references.
@@ -22,15 +22,15 @@ Editor's Note: This link name above "SDK Load Failure" has a direct references b
2222

2323
The following sections discuss the symptoms, causes, and solutions for a specific SDK load failure scenario for JavaScript web apps.
2424

25-
## Symptoms
25+
### Symptoms
2626

2727
In the \<head> element of the web page that you're monitoring, the [JavaScript snippet][snippet-based-setup] (version 3 or a later version) creates and reports the following exception when it detects that the SDK script didn't download or initialize:
2828

2929
> SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details)
3030
3131
This message indicates that the user's client (browser) can't download the Application Insights SDK or initialize from the identified hosting page. Therefore, you don't see any telemetry or events.
3232

33-
:::image type="content" source="./media/javascript-sdk-troubleshooting/overview.png" alt-text="Azure portal screenshot of the exception titled 'SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details)'." lightbox="./media/javascript-sdk-troubleshooting/overview.png":::
33+
:::image type="content" source="./media/javascript-sdk-troubleshooting/overview.png" alt-text="Azure portal screenshot of the exception titled 'SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details).'" lightbox="./media/javascript-sdk-troubleshooting/overview.png":::
3434

3535
> [!NOTE]
3636
> This exception is supported on all major browsers that support the `fetch()` API or `XMLHttpRequest`. These browser versions exclude Microsoft Internet Explorer 8 and earlier versions. Therefore, those browsers will not report this type of exception unless your environment includes a fetch polyfill.
@@ -63,15 +63,15 @@ The following sections discuss how to troubleshoot each potential root cause of
6363
> [!NOTE]
6464
> Some of these steps assume that your application has direct control of the [Snippet \<script /> tag][snippet-based-setup] and its configuration that's returned as part of the hosting HTML page. If these conditions don't apply to your scenario, these steps also don't apply.
6565
66-
## Cause 1: Intermittent network connectivity failure
66+
### Cause 1: Intermittent network connectivity failure
6767

6868
If the user experiences intermittent network connectivity failures, there are fewer possible solutions than for other causes. However, this failure usually resolves itself quickly. For example, if the user refreshes the page to reload your site, the files eventually get downloaded and cached locally until the release of an updated version.
6969

70-
### Solution 1a: Download an updated version of the SDK
70+
#### Solution 1a: Download an updated version of the SDK
7171

7272
To minimize intermittent network connectivity failure, we implemented `Cache-Control` headers on all the CDN files. After the user's browser downloads the current version of the SDK, it doesn't have to download it again because it reuses the previously obtained copy. (See [how caching works](/azure/cdn/cdn-how-caching-works).) If the caching check fails or there's a new release available, the user's browser has to download the updated version. Therefore, you might see a background level of *"noise"* in the check failure scenario. Or, you might see a temporary spike when a new release occurs and becomes generally available (deployed to the CDN).
7373

74-
### Solution 1b: Use npm packages to embed the SDK together with the application in a single bundle
74+
#### Solution 1b: Use npm packages to embed the SDK together with the application in a single bundle
7575

7676
Is the SDK load failure exception persistent, and does it occur for many users together with a reduction in normal client telemetry? In this case, intermittent network connectivity issues probably aren't the true cause of the problem, and you should explore other possible causes.
7777

@@ -82,21 +82,21 @@ In this situation, hosting the SDK on your own CDN is unlikely to provide or red
8282

8383
You can try to [use npm packages to embed the Application Insights SDK](#solution-4b3-use-npm-packages-to-embed-the-application-insights-sdk) together with the monitored application in a single bundle. Although an intermittency failure might still occur in this scenario, a combined bundle does offer a real chance of fixing the problem.
8484

85-
## Cause 2: Application Insights CDN outage
85+
### Cause 2: Application Insights CDN outage
8686

8787
To verify that there's an Application Insights CDN outage, try to access the CDN endpoint directly from the browser from a different location than that of your users. For example, you can try accessing <https://js.monitor.azure.com/scripts/b/ai.2.min.js> from your own development computer. (This assumes that your organization hasn't blocked this domain.)
8888

89-
### Solution 2: Create a support ticket
89+
#### Solution 2: Create a support ticket
9090

9191
If you verify that an outage exists, you can [create a new support ticket][support-ticket].
9292

93-
## Cause 3: SDK didn't initialize after loading the script
93+
### Cause 3: SDK didn't initialize after loading the script
9494

9595
If the SDK doesn't initialize, the \<script /> is still successfully downloaded from the CDN, but it fails during initialization. This failure occurs because of missing or invalid dependencies, or because of some form of JavaScript exception.
9696

97-
### Solution 3: Check for a successful SDK download or JavaScript exceptions, or enable browser debugging
97+
#### Solution 3: Check for a successful SDK download or JavaScript exceptions, or enable browser debugging
9898

99-
#### Step 1: Check for a successful SDK download
99+
##### Step 1: Check for a successful SDK download
100100

101101
Check whether the SDK downloaded successfully. If no script download occurred, this scenario isn't the cause of the SDK load failure exception. Use a browser that supports developer tools. Select F12 to view the developer tools, and then select the **Network** tab. Verify that the script that's defined in the [src snippet configuration][snippet-configuration-options] was downloaded. To do this, check for response code `200` (success) or `304` (not changed). To review the network traffic, you can also use a web debugging tool such as [Fiddler](https://www.telerik.com/fiddler).
102102

@@ -109,7 +109,7 @@ If the SDK didn't download successfully, review the following table to understan
109109

110110
If the SDK downloaded successfully, review the following sections to help fix the SDK initialization problem.
111111

112-
#### Step 2: Check for JavaScript exceptions
112+
##### Step 2: Check for JavaScript exceptions
113113

114114
Check for JavaScript exceptions. Use a browser that supports developer tools. Select F12 to view the developer tools, load the page, and then check whether any exceptions occurred. Does the SDK script (for example, in *ai.2.min.js*) causes exceptions? In this case, one of the following scenarios occurred:
115115

@@ -140,7 +140,7 @@ If the exception disappears, a type mismatch or unexpected value is probably cau
140140

141141
Was your configuration previously deployed and working, but is now reporting this exception? In this case, there might be an issue that affects a newly deployed version. Check whether the exception affects only a small set of your users or browsers. Either [file an issue on GitHub][github-issue] or [create a new support ticket][support-ticket].
142142

143-
#### Step 3: Enable browser console debugging
143+
##### Step 3: Enable browser console debugging
144144

145145
If no thrown exceptions occurred, you should enable console debugging by adding the [loggingLevelConsole setting][snippet-configuration-fields] to the configuration, as shown in the following snippet configuration example. This change sends all initialization errors and warnings to the browser's console. (To view the browser console, select F12 to open the developer tools, and then select the **Console** tab.) Any reported errors should be self-explanatory. If you need further assistance, [file an issue on GitHub][github-issue].
146146

@@ -176,7 +176,7 @@ cfg:{
176176

177177
If this action still doesn't provide any insights, you should [file an issue on GitHub][github-issue] by providing the details and an example site, if you use one. Include the browser version, operating system, and JavaScript framework details to help identify the issue.
178178

179-
## Cause 4: Blockage of the Application Insights JavaScript CDN
179+
### Cause 4: Blockage of the Application Insights JavaScript CDN
180180

181181
A CDN blockage is possible if an Application Insights JavaScript SDK CDN endpoint is reported or identified as unsafe. In this situation, the endpoint is publicly blocklisted, and consumers of these lists start to block all access.
182182

@@ -194,7 +194,7 @@ If the CDN endpoint is identified as unsafe, [create a support ticket][support-t
194194

195195
The following sections outline more specifically how a blockage can occur, and how to fix the blockage.
196196

197-
### Cause 4a: User blockage (browser, installed blocker, or personal firewall)
197+
#### Cause 4a: User blockage (browser, installed blocker, or personal firewall)
198198

199199
Check whether your users have taken any of the following configuration actions:
200200

@@ -204,7 +204,7 @@ Check whether your users have taken any of the following configuration actions:
204204

205205
- Configured a firewall rule that causes a blockage of the CDN domain for the SDK (or a failure to resolve the DNS entry)
206206

207-
#### Solution 4a: Add blocklist exceptions for CDN endpoints
207+
##### Solution 4a: Add blocklist exceptions for CDN endpoints
208208

209209
If your users took any of the listed configuration actions, work with them (or provide documentation) to allow the CDN endpoints.
210210

@@ -214,22 +214,22 @@ Tell your users to allow the downloading of scripts from the Application Insight
214214

215215
Here's an example of this situation that shows how to [configure Google Chrome to allow or block access to websites](https://support.google.com/chrome/a/answer/7532419?hl=en).
216216

217-
### Cause 4b: Corporate firewall blockage
217+
#### Cause 4b: Corporate firewall blockage
218218

219219
If your users are on a corporate network, the corporate firewall is likely the source of the CDN blockage. The corporate IT department has probably implemented some form of internet filtering system.
220220

221-
#### Solution 4b1: Add exceptions for CDN endpoints for corporations
221+
##### Solution 4b1: Add exceptions for CDN endpoints for corporations
222222

223223
> [!IMPORTANT]
224224
> Do your users use a [private cloud](https://azure.microsoft.com/overview/what-is-a-private-cloud/), and do they not have access to the public internet? In this case, you have to either [use the Application Insights npm packages to embed the SDK](#solution-4b3-use-npm-packages-to-embed-the-application-insights-sdk), or [host the Application Insights SDK on your own CDN](#solution-4b2-host-the-sdk-on-your-own-cdn).
225225
226226
Work with your company's IT department to allow the necessary rules for your users. This solution is similar to [adding exceptions for users](#solution-4a-add-blocklist-exceptions-for-cdn-endpoints). Have the IT department configure the Application Insights CDN endpoints for download by including (or removing) them in any domain blocklisting or allowlisting services.
227227

228-
#### Solution 4b2: Host the SDK on your own CDN
228+
##### Solution 4b2: Host the SDK on your own CDN
229229

230230
Instead of having users download the Application Insights SDK from the public CDN, you can host the Application Insights SDK on your own CDN endpoint. We recommend that you use a specific version (*ai.2.#.#.min.js*) of the SDK to make it easier to identify which version you're using. Also, update the SDK regularly to the current version (*ai.2.min.js*) so that you can use any bug fixes and new features that become available.
231231

232-
#### Solution 4b3: Use npm packages to embed the Application Insights SDK
232+
##### Solution 4b3: Use npm packages to embed the Application Insights SDK
233233

234234
Instead of using the [snippet][snippet-based-setup] and [adding public CDN endpoints](#solution-4a-add-blocklist-exceptions-for-cdn-endpoints), you can use the [npm packages](https://www.npmjs.com/package/applicationinsights) to include the SDK as part of your own JavaScript files. The SDK becomes just another package within your own scripts. For more information, see the [npm-based setup][npm-based-setup] section of the Application Insights JavaScript SDK GitHub page.
235235

@@ -249,15 +249,15 @@ The following table explains certain issues that involve [source map support for
249249

250250
## Fix the "Click Event rows with no parentId value" warning
251251

252-
When you use Azure application insights and [Click Analytics auto collection plug-in](/azure/azure-monitor/app/javascript-feature-extensions) in the application, the following telemetry warning may appear in the application insights workbook: "Click Event rows with no parentId value".
252+
When you use Application Insights and the [Click Analytics Auto-Collection plug-in](/azure/azure-monitor/app/javascript-feature-extensions) in the application, the following telemetry warning might appear in the application insights workbook: "Click Event rows with no parentId value."
253253

254254
### Cause
255255

256-
This can occur if the `parentid` is not specified in the parent html element, which causes the event to be triggered on all of its parent elements.
256+
This issue can occur if the parent ID isn't specified in the parent HTML element. This condition causes the event to be triggered on all of its parent elements.
257257

258258
### Solution
259259

260-
To fix this issue, add the `data-parentid` or `data-<customPrefix>-parentid` to the parent html element. Here is an example of the HTML code:
260+
To fix this issue, add the `data-parentid` or `data-<customPrefix>-parentid` attribute to the parent HTML element. Here's an example of the HTML code:
261261

262262
```html
263263
<div data-heart-id="demo Header" data-heart-parentid="demo.Header" data-heart-parent-group="demo.Header.Group">

0 commit comments

Comments
 (0)