We have an Azure PaaS environment for Sitecore 9.3 and Solr App services created. Is there any way to connect Application Insights for the Solr App service? For CM and CD services we have setup the application insights by providing the instrumentation key on the connection string. For Solr, how should we do that? Please help!
1 Answer
Since Solr is a Java application, you can instrument it using the Application Insights Java Agent, following these steps:
Download the Application Insights Java agent from the official GitHub repository releases page.
Copy the downloaded agent on the Azure VM where your Solr instance is hosted.
Add the
-javaagent
to your Solr application's JVM arguments, editing thesolr.in.cmd
file in yoursolr\bin
folder and adding the following solr options definition:
set SOLR_OPTS=%SOLR_OPTS% -javaagent:"path\to\applicationinsights-agent-3.0.2.jar"
If Solr is configured with its own certificate keystore, you will need to import the SSL certificate of the Azure services that the agent sends telemetry data to, using the
keytool
Java tool. Instructions to import an SSL certificate in a keystore are described in the agent troubleshooting guide here. If this step is not correctly executed, you will see errors logged by the agent in theapplicationinsights.log
file (generated in the same folder location where the Java agent is hosted), with the descriptionUnable to find valid certification path to requested target
. There are two services that the agent uses:- The Live metrics endpoint: https://rt.services.visualstudio.com
- The CdsProfiler endpoint: https://eastus2-0.in.applicationinsights.azure.com (this endpoint is different based on the region of your App Insights resource - This endpoint is for an App Insights instance in the East 2 region).
Restart the Solr service.
If the Application Insights Java agent runs successfully, you should have only an INFO record in the applicationinsights.log
file confirming that the agent started successfully and no error recorded:
INFO c.m.applicationinsights.agent - ApplicationInsights Java Agent 3.0.2 started successfully
In your Application Insights instance, you should see Solr logs collected in traces
and Solr service requests collected in requests
:
Additional official Microsoft documentation about the Application Insights codeless Java application instrumentation can be found here.
-
Thanks for the details.. Since we are using PaaS (severless) we followed the link - Java codeless application monitoring Azure Monitor Application Insights - docs.microsoft.com/en-us/azure/azure-monitor/app/…– user7713Jan 28, 2021 at 8:26