Skip to content

Commit e69d4fb

Browse files
authored
Merge pull request #183008 from kryalama/kryalama/troubledocs
fix Java agent troubleshooting docs
2 parents b7656e0 + a853c67 commit e69d4fb

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

articles/azure-monitor/app/java-in-process-agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ If you want to attach custom dimensions to your logs, use [Log4j 1.2 MDC](https:
369369

370370
1. Create a TelemetryClient:
371371
372-
```java
372+
```java
373373
static final TelemetryClient telemetryClient = new TelemetryClient();
374374
```
375375

articles/azure-monitor/app/java-standalone-troubleshoot.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,49 +72,47 @@ and the JVM arg will point you to your custom keystore.
7272

7373
Typically the default Java keystore will already have all of the CA root certificates. However there might be some exceptions, such as the ingestion endpoint certificate might be signed by a different root certificate. So we recommend the following three steps to resolve this issue:
7474

75-
1. Check if the root certificate that was used to sign the Application Insights endpoint is already present in the default keystore. The trusted CA certificates, by default, are stored in `$JAVA_HOME/jre/lib/security/cacerts`. To list certificates in a Java keystore use the following command:
75+
1. Check if the SSL certificate that was used to sign the Application Insights endpoint is already present in the default keystore. The trusted CA certificates, by default, are stored in `$JAVA_HOME/jre/lib/security/cacerts`. To list certificates in a Java keystore use the following command:
7676
> `keytool -list -v -keystore $PATH_TO_KEYSTORE_FILE`
7777

7878
You can redirect the output to a temp file like this (will be easy to search later)
7979
> `keytool -list -v -keystore $JAVA_HOME/jre/lib/security/cacerts > temp.txt`
8080

81-
2. Once you have the list of certificates, follow these [steps](#steps-to-download-ssl-certificate) to download the root certificate that was used to sign the Application Insights endpoint.
81+
2. Once you have the list of certificates, follow these [steps](#steps-to-download-ssl-certificate) to download the SSL certificate that was used to sign the Application Insights endpoint.
8282

8383
Once you have the certificate downloaded, generate a SHA-1 hash on the certificate using the below command:
84-
> `keytool -printcert -v -file "your_downloaded_root_certificate.cer"`
84+
> `keytool -printcert -v -file "your_downloaded_ssl_certificate.cer"`
8585
86-
Copy the SHA-1 value and check if this value is present in "temp.txt" file you saved previously. If you are not able to find the SHA-1 value in the temp file, it indicates that the downloaded root cert is missing in default Java keystore.
86+
Copy the SHA-1 value and check if this value is present in "temp.txt" file you saved previously. If you are not able to find the SHA-1 value in the temp file, it indicates that the downloaded SSL cert is missing in default Java keystore.
8787

8888

89-
3. Import the root certificate to the default Java keystore using the following command:
89+
3. Import the SSL certificate to the default Java keystore using the following command:
9090
> `keytool -import -file "the cert file" -alias "some meaningful name" -keystore "path to cacerts file"`
9191
9292
In this case it will be
9393

94-
> `keytool -import -file "your downloaded root cert file" -alias "some meaningful name" $JAVA_HOME/jre/lib/security/cacerts`
94+
> `keytool -import -file "your downloaded ssl cert file" -alias "some meaningful name" $JAVA_HOME/jre/lib/security/cacerts`
9595
9696

9797
### If using a custom Java keystore:
9898

99-
If you are using a custom Java keystore, you may need to import the Application Insights endpoint(s) root SSL certificate(s) into it.
99+
If you are using a custom Java keystore, you may need to import the Application Insights endpoint(s) SSL certificate(s) into it.
100100
We recommend the following two steps to resolve this issue:
101-
1. Follow these [steps](#steps-to-download-ssl-certificate) to download the root certificate from the Application Insights endpoint.
102-
2. Use the following command to import the root SSL certificate to the custom Java keystore:
101+
1. Follow these [steps](#steps-to-download-ssl-certificate) to download the SSL certificate from the Application Insights endpoint.
102+
2. Use the following command to import the SSL certificate to the custom Java keystore:
103103
> `keytool -importcert -alias your_ssl_certificate -file "your downloaded SSL certificate name.cer" -keystore "Your KeyStore name" -storepass "Your keystore password" -noprompt`
104104
105105
### Steps to download SSL certificate
106106

107-
1. Open your favorite browser and go to the `IngestionEndpoint` URL present in the connection string that's used to instrument your application.
108-
109-
:::image type="content" source="media/java-ipa/troubleshooting/ingestion-endpoint-snippet.png" alt-text="Screenshot that shows an Application Insights connection string." lightbox="media/java-ipa/troubleshooting/ingestion-endpoint-snippet.png":::
107+
1. Open your favorite browser and go to the URL from which you want to download the SSL certificate.
110108

111109
2. Select the **View site information** (lock) icon in the browser, and then select the **Certificate** option.
112110

113111
:::image type="content" source="media/java-ipa/troubleshooting/certificate-icon-capture.png" alt-text="Screenshot of the Certificate option in site information." lightbox="media/java-ipa/troubleshooting/certificate-icon-capture.png":::
114112

115-
3. Instead of downloading the 'leaf' certificate you should download the 'root' certificate as shown below. Later, you have to click on the "Certificate Path" -> Select the Root Certificate -> Click on 'View Certificate'. This will pop up a new certificate menu and you can download the certificate, from the new menu.
113+
3. Later, you have to click on the "Certificate Path" -> Select the root Certificate -> Click on 'View Certificate'. This will pop up a new certificate menu and you can download the certificate, from the new menu.
116114

117-
:::image type="content" source="media/java-ipa/troubleshooting/root-certificate-selection.png" alt-text="Screenshot of how to select the root certificate." lightbox="media/java-ipa/troubleshooting/root-certificate-selection.png":::
115+
:::image type="content" source="media/java-ipa/troubleshooting/root-certificate.png" alt-text="Screenshot of how to select the root certificate." lightbox="media/java-ipa/troubleshooting/root-certificate.png":::
118116

119117
4. Go to the **Details** tab and select **Copy to file**.
120118
5. Select the **Next** button, select **Base-64 encoded X.509 (.CER)** format, and then select **Next** again.
@@ -127,3 +125,8 @@ We recommend the following two steps to resolve this issue:
127125
> You'll need 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** dialog box.
128126
>
129127
> :::image type="content" source="media/java-ipa/troubleshooting/certificate-details.png" alt-text="Screenshot that shows SSL certificate details." lightbox="media/java-ipa/troubleshooting/certificate-details.png":::
128+
129+
## Understanding UnknownHostException
130+
131+
If you see this exception after upgrading to Java agent version greater than 3.2.0, upgrading your network to resolve the new endpoint shown in the exception might resolve the exception. The reason for the difference between Application Insights versions is that versions greater than 3.2.0 point to the new ingestion endpoint `v2.1/track` compared to the older `v2/track`. The new ingestion endpoint automatically redirects you to the ingestion endpoint (new endpoint shown in exception) nearest to the storage for your Application Insights resource.
132+
10.6 KB
Loading

0 commit comments

Comments
 (0)