Our SonarQube integration monitors the performance of your SonarQube application, helping you diagnose and optimize the code. Our SonarQube integration makes use of our infrastructure agent, PosgreSQL agent, NRI-Prometheus, and NRI-JMX and gives you a pre-built dashboard with your most important SonarQube metrics.
After setting up our SonarQube integration, we give you a dashboard for your SonarQube metrics.
You can install the infrastructure agent two different ways:
- Our guided install is a CLI tool that inspects your system and installs the infrastructure agent alongside the application monitoring agent that best works for your system. To learn more about how our guided install works, check out our Guided install overview.
- If you'd rather install our infrastructure agent manually, you can follow a tutorial for manual installation for Linux, Windows, or macOS.
- Check out our PostgreSQL agent requirements in our documentation before installing the agent.
- Open PostgreSQL Quickstart page PostgreSQL quickstart installation.
- Click Install now to start the PostgreSQL quickstart installation.
Below are the two ways which has to be followed to integrate SonarQube with New Relic.
- nri-prometheus configuration
- nri-jmx configuration
Our SonarQube dashboard takes data scraped from your JMX integration and translates it into dashboards. By storing all your data in New Relic, you've a one stop shop to get a full overview of your system's health.
If you haven't already, you'll need to install our JMX monitoring integration. You'll need to make some additional configurations once it's installed.
sudo apt-get install nri-jmx
You can use our log forwarding to forward SonarQube logs to New Relic.
On Linux machines, your log file named
logging.yml should be present in this path:
After creating the log file, add the following script to the
logs:- name: sonar_logsfile: /opt/sonarqube/logs/sonar.logattributes:logtype: sonar_logs- name: ce_logsfile: /opt/sonarqube/logs/ce.logattributes:logtype: sonar_ce_logs- name: es_logsfile: /opt/sonarqube/logs/es.logattributes:logtype: sonar_es_logs- name: web_logsfile: /opt/sonarqube/logs/web.logattributes:logtype: sonar_web_logs
Restart your infrastructure agent.
$sudo systemctl restart newrelic-infra.service
In a couple of minutes, your application will send metrics to one.newrelic.com.
You can choose our pre-built dashboard template named
SonarQube to monitor your SonarQube application metrics. Follow these steps to use our pre-built dashboard template:
- From one.newrelic.com, go to the + Add data page.
- Click on Dashboards.
- In the search bar, type
- The SonarQube dashboard should appear. Click on it to install it.
Your SonarQube dashboard is considered a custom dashboard and can be found in the Dashboards UI. For docs on using and editing dashboards, see our dashboard docs.
Here is a NRQL query to check your SonarQube web status:
SELECT latest(sonarqube_web_uptime_minutes)AS 'SonarQube Web Uptime (minutes)'FROM Metric
Run the following NRQL query using
EVENT_NAME to view the JVM metrics:
SELECT latest(PoolIdleConnections) FROM JVMSampleSonarQubeWebMetrics
To learn more about building NRQL queries and generating dashboards, check out these docs: