• English日本語한국어
  • Log inStart now

SonarQube monitoring integration

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.

Install the infrastructure agent

You can install the infrastructure agent two different ways:

Install the PostgreSQL

  1. Check out our PostgreSQL agent requirements in our documentation before installing the agent.
  2. Open PostgreSQL Quickstart page PostgreSQL quickstart installation.
  3. Click Install now to start the PostgreSQL quickstart installation.

Integrate SonarQube with New Relic

Below are the two ways which has to be followed to integrate SonarQube with New Relic.

  1. nri-prometheus configuration
  2. nri-jmx configuration

Configure NRI-JMX

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.

Example: sudo apt-get install nri-jmx

Forward SonarQube logs to New Relic

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:

cd /etc/newrelic-infra/logging.d/

After creating the log file, add the following script to the logging.yml file:

- name: sonar_logs
file: /opt/sonarqube/logs/sonar.log
logtype: sonar_logs
- name: ce_logs
file: /opt/sonarqube/logs/ce.log
logtype: sonar_ce_logs
- name: es_logs
file: /opt/sonarqube/logs/es.log
logtype: sonar_es_logs
- name: web_logs
file: /opt/sonarqube/logs/web.log
logtype: sonar_web_logs

Restart the New Relic infrastructure agent

Restart your infrastructure agent.

sudo systemctl restart newrelic-infra.service

In a couple of minutes, your application will send metrics to one.newrelic.com.

Find your data

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:

  1. From one.newrelic.com, go to the + Add data page.
  2. Click on Dashboards.
  3. In the search bar, type sonarqube.
  4. 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

What's next?

To learn more about building NRQL queries and generating dashboards, check out these docs:

Copyright © 2023 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.