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!
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.
-javaagentto your Solr application's JVM arguments, editing the
solr.in.cmdfile in your
solr\binfolder 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
keytoolJava 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 the
applicationinsights.logfile (generated in the same folder location where the Java agent is hosted), with the description
Unable 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
Additional official Microsoft documentation about the Application Insights codeless Java application instrumentation can be found here.