You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: support/azure/azure-monitor/app-insights/telemetry/java-standalone-troubleshoot.md
+52-45Lines changed: 52 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,15 +18,15 @@ This article provides troubleshooting information to resolve common issues that
18
18
19
19
## Check the self-diagnostic log file
20
20
21
-
By default, Application Insights Java 3._x_ produces a log file that's named *applicationinsights.log* in the same directory
21
+
By default, Application Insights Java 3.*x* produces a log file that's named *applicationinsights.log* in the same directory
22
22
that holds the *applicationinsights-agent-3.2.11.jar* file.
23
23
24
24
This log file is the first place to check for hints about any issues that you might be experiencing.
25
25
26
26
If Application Insights doesn't generate a log file, check to make sure that your Java application has the Write permission to the directory that holds the
27
27
*applicationinsights-agent-3.2.11.jar* file.
28
28
29
-
If Application Insights still doesn't generate a log file, check the `stdout` log from your Java application for errors. Application Insights Java 3._x_
29
+
If Application Insights still doesn't generate a log file, check the `stdout` log from your Java application for errors. Application Insights Java 3.*x*
30
30
should log any errors that would prevent it from logging to its usual location in the `stdout` log.
31
31
32
32
## Troubleshoot connectivity issues
@@ -35,56 +35,56 @@ Application Insights SDKs and agents send telemetry to be ingested as REST calls
35
35
36
36
If the Application Insights Java agent causes the connectivity issue, consider the following options:
37
37
38
-
-[Verify the connection string for the Application Insights configuration](/azure/azure-monitor/app/java-standalone-config#connection-string).
38
+
*[Verify the connection string for the Application Insights configuration](/azure/azure-monitor/app/java-standalone-config#connection-string).
39
39
40
-
- Use Application Insights Java version 3.4.6 or a later version to verify that the Java keystore contains a required certificate. To do this, [enable the self-diagnostics feature](/azure/azure-monitor/app/java-standalone-config#self-diagnostics) at the `TRACE` level. In the Application Insights logs, do you see the following entry?
40
+
* Use Application Insights Java version 3.4.6 or a later version to verify that the Java keystore contains a required certificate. To do this, [enable the self-diagnostics feature](/azure/azure-monitor/app/java-standalone-config#self-diagnostics) at the `TRACE` level. In the Application Insights logs, do you see the following entry?
41
41
42
-
> TRACE c.m.applicationinsights.agent - Application Insights root certificate in the Java keystore: false
42
+
> TRACE c.m.applicationinsights.agent - Application Insights root certificate in the Java keystore: false
43
43
44
-
If you see this entry, refer to [Import SSL certificates](#import-ssl-certificates) to import a root certificate in the Java keystore.
44
+
If you see this entry, refer to [Import SSL certificates](#import-ssl-certificates) to import a root certificate in the Java keystore.
45
45
46
-
- If you use the `-Djsse.enableSNIExtension=false` option, try to run the agent without that option. From Application Insights Java version 3.4.5, if you specify `-Djsse.enableSNIExtension=false`, the following error entry appears in the logs:
46
+
* If you use the `-Djsse.enableSNIExtension=false` option, try to run the agent without that option. From Application Insights Java version 3.4.5, if you specify `-Djsse.enableSNIExtension=false`, the following error entry appears in the logs:
47
47
48
-
> WARN c.m.applicationinsights.agent - System property -Djsse.enableSNIExtension=false is detected. If you have connection issues with Application Insights, please remove this.
48
+
> WARN c.m.applicationinsights.agent - System property -Djsse.enableSNIExtension=false is detected. If you have connection issues with Application Insights, please remove this.
49
49
50
-
- If none of the previous options are helpful, you can use [troubleshooting tools](https://github.com/microsoft/ApplicationInsights-Java/wiki/Diagnose-connection-to-the-Application-Insights-backend-(3.x)#additional-tests).
50
+
* If none of the previous options are helpful, you can use [troubleshooting tools](https://github.com/microsoft/ApplicationInsights-Java/wiki/Diagnose-connection-to-the-Application-Insights-backend-(3.x)#additional-tests).
51
51
52
52
## Java virtual machine (JVM) fails to start
53
53
54
54
If the Java virtual machine (JVM) doesn't start, it might return an "Error opening zip file or JAR manifest missing" message. To troubleshoot this problem, see the following table.
55
55
56
56
| Problem | Action |
57
-
|--|--|
57
+
|---------|--------|
58
58
| The Java archive (JAR) file for the agent isn't found. | Make sure that you specify a valid agent JAR path in the `-javaagent` JVM argument. |
59
59
| The agent JAR file might have been corrupted during file transfer. | Try to download the agent JAR file again. |
60
60
61
61
## Tomcat Java apps take several minutes to start
62
62
63
63
If you [enabled Application Insights to monitor your Tomcat application](/azure/azure-monitor/app/java-standalone-arguments#tomcat-8-linux), there might be a several-minute delay in the time that it takes to start the application. This delay is caused because Tomcat tries to scan the Application Insights JAR files during application startup. To speed up the application start time, you can exclude the Application Insights JAR files from the list of scanned files. Scanning these JAR files isn't necessary.
64
64
65
-
## Upgrade from the Application Insights Java 2._x_ SDK
65
+
## Upgrade from the Application Insights Java 2.*x* SDK
66
66
67
-
If you're already using the Application Insights Java 2._x_ SDK in your application, you can keep using it. The Application Insights Java 3._x_ agent detects, captures, and correlates any custom telemetry that you send through the 2._x_ SDK. It also prevents duplicate telemetry by suppressing any auto-collection that the 2._x_ SDK does. For more information, see [Upgrade from the Java 2._x_ SDK](/azure/azure-monitor/app/java-standalone-upgrade-from-2x).
67
+
If you're already using the Application Insights Java 2.*x* SDK in your application, you can keep using it. The Application Insights Java 3.*x* agent detects, captures, and correlates any custom telemetry that you send through the 2.*x* SDK. It also prevents duplicate telemetry by suppressing any auto-collection that the 2.*x* SDK does. For more information, see [Upgrade from the Java 2.*x* SDK](/azure/azure-monitor/app/java-standalone-upgrade-from-2x).
68
68
69
69
## Upgrade from Application Insights Java 3.0 preview
70
70
71
71
If you're upgrading from the Java 3.0 Preview agent, review all the [configuration options](/azure/azure-monitor/app/java-standalone-config) carefully. The JSON structure is changed in the 3.0 general availability (GA) release.
72
72
73
73
These changes include:
74
74
75
-
- The configuration file name changed from *ApplicationInsights.json* to *applicationinsights.json*.
75
+
* The configuration file name changed from *ApplicationInsights.json* to *applicationinsights.json*.
76
76
77
-
- The `instrumentationSettings` node is no longer present. All content in `instrumentationSettings` is moved to the root level.
77
+
* The `instrumentationSettings` node is no longer present. All content in `instrumentationSettings` is moved to the root level.
78
78
79
-
- Configuration nodes such as `sampling`, `jmxMetrics`, `instrumentation`, and `heartbeat` are moved out of `preview` to the root level.
79
+
* Configuration nodes such as `sampling`, `jmxMetrics`, `instrumentation`, and `heartbeat` are moved out of `preview` to the root level.
80
80
81
81
## Some logging isn't auto-collected
82
82
83
83
Logging is captured only if it meets the following criteria:
84
84
85
-
- It meets the level that's configured for the logging framework.
85
+
* It meets the level that's configured for the logging framework.
86
86
87
-
- It meets the level that's configured for Application Insights.
87
+
* It meets the level that's configured for Application Insights.
88
88
89
89
For example, if your logging framework is configured to log `WARN` (and above) from the `com.example` package, and Application Insights is configured to capture `INFO` (and above), then Application Insights only captures `WARN` (and above) from the `com.example` package.
90
90
@@ -107,8 +107,8 @@ This section helps you to troubleshoot and possibly fix the exceptions that are
107
107
108
108
There are two different paths for resolving this issue:
109
109
110
-
- If you're using a default Java keystore
111
-
- If you're using a custom Java keystore
110
+
* If you're using a default Java keystore
111
+
* If you're using a custom Java keystore
112
112
113
113
If you aren't sure which path to follow, check to see whether you have the JVM argument, `-Djavax.net.ssl.trustStore=...`.
114
114
If you don't have this JVM argument, then you're probably using the default Java keystore.
@@ -124,14 +124,14 @@ The default Java keystore typically already has all the CA root certificates. Ho
124
124
You can redirect the output to a temporary file so that it's easy to search on later:
2. After you have the list of certificates, follow the [steps to download the SSL certificate](#steps-to-download-the-ssl-certificate) that was used to sign the Application Insights endpoint.
127
+
1. After you have the list of certificates, follow the [steps to download the SSL certificate](#steps-to-download-the-ssl-certificate) that was used to sign the Application Insights endpoint.
128
128
129
129
After you download the certificate, generate an SHA-1 hash on the certificate by using the following command:
Copy the SHA-1 value, and check whether this value is present in the *temp.txt* file that you saved previously. If you can't find the SHA-1 value in the temporary file, then the downloaded SSL certificate is missing in the default Java keystore.
133
133
134
-
3. Import the SSL certificate to the default Java keystore by using the following command:
134
+
1. Import the SSL certificate to the default Java keystore by using the following command:
> The following SSL certificate download instructions were validated on the following browsers:
155
156
>
156
-
> - Google Chrome
157
-
> - Microsoft Edge
157
+
> * Google Chrome
158
+
> * Microsoft Edge
158
159
159
160
1. Open the <https://westeurope-5.in.applicationinsights.azure.com/api/ping> URL address in a web browser.
160
161
161
-
2. In the browser's address bar, select the **View site information** icon (a lock symbol that's next to the address).
162
+
1. In the browser's address bar, select the **View site information** icon (a lock symbol that's next to the address).
162
163
163
-
3. Select **Connection is secure**.
164
+
1. Select **Connection is secure**.
164
165
165
-
4. Select the **Show certificate** icon.
166
+
1. Select the **Show certificate** icon.
166
167
167
-
5. In the **Certificate Viewer** dialog box, select the **Details** tab.
168
+
1. In the **Certificate Viewer** dialog box, select the **Details** tab.
168
169
169
-
6. In the **Certificate Hierarchy** list, select the certificate that you want to download. (The CA root certificate, the intermediate certificate, and the leaf SSL certificate are shown.)
170
+
1. In the **Certificate Hierarchy** list, select the certificate that you want to download. (The CA root certificate, the intermediate certificate, and the leaf SSL certificate are shown.)
170
171
171
-
7. Select the **Export** button.
172
+
1. Select the **Export** button.
172
173
173
-
8. In the **Save As** dialog box, browse to the directory to which you want to save the certificate (.crt) file, and then select **Save**.
174
+
1. In the **Save As** dialog box, browse to the directory to which you want to save the certificate (.crt) file, and then select **Save**.
174
175
175
-
9. To exit the **Certificate Viewer** dialog box, select the **Close** (X) button.
176
+
1. To exit the **Certificate Viewer** dialog box, select the **Close** (X) button.
176
177
177
178
> [!WARNING]
178
179
> You'll have to repeat these steps to get the new certificate before the current certificate expires. You can find the expiration information on the **Details** tab of the **Certificate Viewer** dialog box.
@@ -216,10 +217,10 @@ public class Ciphers {
216
217
217
218
The Application Insights endpoints support the following cipher suites:
218
219
219
-
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
220
-
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
221
-
- TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
222
-
- TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
220
+
* TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
221
+
* TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
222
+
* TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
223
+
* TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
223
224
224
225
#### How to determine server side cipher suites
225
226
@@ -231,29 +232,28 @@ If you're using Java 9 or a later version, check to make sure that the JVM inclu
231
232
232
233
Otherwise, these cipher suites should already be part of modern Java 8+ distributions. We recommend that you check the source of your installed Java distribution to investigate why the security providers in that Java distribution's *java.security* configuration file differ from standard Java distributions.
233
234
234
-
## Slow startup time in Application Insights
235
+
## Slow startup time in Application Insights
235
236
236
237
### Java 8
237
238
238
239
Java 8 has a known issue that's related to the JAR file signature verification of Java agents. This issue can increase the startup time in Application Insights. To fix this issue, you can apply one of the following options:
239
240
240
-
- If your application is based on Spring Boot, [programmatically attach the Application Insights Java agent to the JVM](/azure/azure-monitor/app/java-spring-boot#enabling-programmatically).
241
+
* If your application is based on Spring Boot, [programmatically attach the Application Insights Java agent to the JVM](/azure/azure-monitor/app/java-spring-boot#enabling-programmatically).
241
242
242
-
- Use Java version 11 or a later version.
243
+
* Use Java version 11 or a later version.
243
244
244
245
### Java higher than version 8
245
246
246
247
To fix this issue with the Application Insights Java agent, try one of the following methods:
247
248
248
-
- Use an Azure configuration with more CPU power.
249
-
- Disable some instrumentations described in [Suppress specific autocollected telemetry](/azure/azure-monitor/app/java-standalone-config#suppress-specific-autocollected-telemetry).
250
-
- Try this experimental feature: [Startup time improvement for a limited number of CPU cores](https://github.com/microsoft/ApplicationInsights-Java/wiki/Start-up-time-improvement-with-a-limited-number-of-CPU-cores-(experimental)). If you experience any issues while using this feature, send us a feedback.
249
+
* Use an Azure configuration with more CPU power.
250
+
* Disable some instrumentations described in [Suppress specific autocollected telemetry](/azure/azure-monitor/app/java-standalone-config#suppress-specific-autocollected-telemetry).
251
+
* Try this experimental feature: [Startup time improvement for a limited number of CPU cores](https://github.com/microsoft/ApplicationInsights-Java/wiki/Start-up-time-improvement-with-a-limited-number-of-CPU-cores-(experimental)). If you experience any issues while using this feature, send us a feedback.
251
252
252
253
You can also try the [monitoring solutions for Java native](/azure/azure-monitor/app/opentelemetry-enable?tabs=java-native) also applicable to a JVM-based application:
253
254
254
-
- With Spring Boot, the Microsoft distribution of the OpenTelemetry starter.
255
-
- With Quarkus, the Quarkus Opentelemetry Exporter for Microsoft Azure.
256
-
255
+
* With Spring Boot, the Microsoft distribution of the OpenTelemetry starter.
256
+
* With Quarkus, the Quarkus Opentelemetry Exporter for Microsoft Azure.
257
257
258
258
## Understand duplicated operation IDs
259
259
@@ -273,6 +273,7 @@ Application logic can result in an operation ID being reused by multiple telemet
273
273
}
274
274
}
275
275
```
276
+
276
277
* Enable [self-diagnostics](/azure/azure-monitor/app/java-standalone-config#self-diagnostics) at the DEBUG level and restart the application.
277
278
278
279
In the following log example, the operation ID comes from an incoming request, not Application Insights:
@@ -281,6 +282,12 @@ Application logic can result in an operation ID being reused by multiple telemet
If you use `regexp` and the sampling override doesn't work, try with the `.*` regex. If the sampling now works, it means you have an issue with the first regex and read [this regex documentation](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html).
288
+
289
+
If it doesn't work with `.*`, you might have a syntax issue in your `application-insights.json file`. Look at the Application Insights logs and see if you notice warning messages.
0 commit comments