From 647fae12f7d9dd3ba370e22518c269350b9dc70a Mon Sep 17 00:00:00 2001 From: Bradley Camacho Date: Thu, 28 Mar 2024 11:30:48 -0700 Subject: [PATCH 1/6] Drafting sonarqube rewrite --- .../sonarqube-monitoring-integration.mdx | 159 +++++++++++++++++- 1 file changed, 158 insertions(+), 1 deletion(-) diff --git a/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx b/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx index f8ada658603..f88f8403113 100644 --- a/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx +++ b/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx @@ -9,7 +9,7 @@ freshnessValidatedDate: 2023-06-28 --- import SonarQubeDashboard from 'images/infrastructure_screenshot_full-sonarqube-dashboard.webp' -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. +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 integration, NRI-Prometheus, and NRI-JMX and gives you a pre-built dashboard with your most important SonarQube metrics. + + +## Install the infrastructure agent [#infra-install] + +To use the SonarQube integration, you need to also [install the infrastructure agent](/docs/infrastructure/install-infrastructure-agent/get-started/install-infrastructure-agent-new-relic/) on the same host. The infrastructure agent monitors the host itself, while the integration you'll install in the next step extends your monitoring with SonarQube-specific data. + + +## Install the PostgreSQL integration + +To use the SonarQube integration, you need to first install our PostgreSQL integration. + +1. Check out our PostgreSQL integration requirements in our [documentation](/docs/infrastructure/host-integrations/host-integrations-list/postgresql/postgresql-integration/) before installing the integration. +2. Open PostgreSQL Quickstart page [PostgreSQL quickstart installation](https://newrelic.com/instant-observability/postresql). +3. Click **Install now** to start the PostgreSQL quickstart installation. + + + +## Configure NRI-Prometheus + +1. Run the following command to create a NRI-Prometheus config file: + + ```shell + touch /etc/newrelic-infra/integrations.d/nri-prometheus-config.yml + ``` +2. Paste the following snippet into the new config file. Be sure to update the `cluster_name` and `urls` fields: + + ```yml + integrations: + - name: nri-prometheus + config: + # When standalone is set to false nri-prometheus requires an infrastructure agent to work and send data. Defaults to true + standalone: false + + # When running with infrastructure agent emitters will have to include infra-sdk + emitters: infra-sdk + + # The name of your cluster. It's important to match other New Relic products to relate the data. + cluster_name: "YOUR_DESIRED_CLUSTER_NAME" + + targets: + - description: Sonarqube metrics list + urls: ["http://user_name:password@YOUR_HOST_IP:9000/api/monitoring/metrics"] + + # tls_config: + # ca_file_path: "/etc/etcd/etcd-client-ca.crt" + # cert_file_path: "/etc/etcd/etcd-client.crt" + # key_file_path: "/etc/etcd/etcd-client.key" + + # Whether the integration should run in verbose mode or not. Defaults to false + verbose: false + + # Whether the integration should run in audit mode or not. Defaults to false. + # Audit mode logs the uncompressed data sent to New Relic. Use this to log all data sent. + # It does not include verbose mode. This can lead to a high log volume, use with care + audit: false + + # The HTTP client timeout when fetching data from endpoints. Defaults to 30s. + # scrape_timeout: "30s" + + # Length in time to distribute the scraping from the endpoints + scrape_duration: "5s" + + # Number of worker threads used for scraping targets. + # For large clusters with many (>400) endpoints, slowly increase until scrape + # time falls between the desired `scrape_duration`. + # Increasing this value too much will result in huge memory consumption if too + # many metrics are being scraped. + # Default: 4 + # worker_threads: 4 + + # Whether the integration should skip TLS verification or not. Defaults to false + insecure_skip_verify: true + timeout: 10s +``` + + + +## Forward SonarQube logs to New Relic + +Follow these steps to forward Envoy logs to New Relic: + +1. Create a log file named `logging.yml` in the following path: + + ```shell + cd /etc/newrelic-infra/logging.d + ``` + +2. Add the following script to the `logging.yml` file: + + ```yml + logs: + - name: sonar_logs + file: /opt/sonarqube/logs/sonar.log + attributes: + logtype: sonar_logs + - name: ce_logs + file: /opt/sonarqube/logs/ce.log + attributes: + logtype: sonar_ce_logs + - name: es_logs + file: /opt/sonarqube/logs/es.log + attributes: + logtype: sonar_es_logs + - name: web_logs + file: /opt/sonarqube/logs/web.log + attributes: + logtype: sonar_web_logs + ``` + + +## Restart the New Relic infrastructure agent + +Restart your infrastructure agent. + +```shell +sudo systemctl restart newrelic-infra.service +``` + +In a couple of minutes, your application will send metrics to [one.newrelic.com](https://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](https://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](/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards). + +Here is a NRQL query to check your SonarQube web status: + +```sql +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: + +```sql +SELECT latest(PoolIdleConnections) FROM JVMSampleSonarQubeWebMetrics +``` + + + + +## What's next? + +To learn more about building NRQL queries and generating dashboards, check out these docs: + +* [Introduction to the query builder](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder) to create basic and advanced queries. +* [Introduction to dashboards](/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards) to customize your dashboard and carry out different actions. +* [Manage your dashboard](/docs/query-your-data/explore-query-data/dashboards/manage-your-dashboard) to adjust your dashboards display mode, or to add more content to your dashboard. + + ## Install the infrastructure agent [#infra-install] You can install the infrastructure agent two different ways: From 8a34ab2b72add5a5b637bd0236f10b21c3483762 Mon Sep 17 00:00:00 2001 From: Bradley Camacho Date: Thu, 28 Mar 2024 11:38:32 -0700 Subject: [PATCH 2/6] Fix indentation --- .../sonarqube-monitoring-integration.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx b/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx index f88f8403113..9b0f50025b8 100644 --- a/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx +++ b/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx @@ -94,7 +94,9 @@ To use the SonarQube integration, you need to first install our PostgreSQL integ # Whether the integration should skip TLS verification or not. Defaults to false insecure_skip_verify: true timeout: 10s -``` + ``` + +3. Testing to see if this reads as a new step From b95e57125ab2ccde7b5c335ad1bf1d0bedd49782 Mon Sep 17 00:00:00 2001 From: Bradley Camacho Date: Thu, 28 Mar 2024 14:06:10 -0700 Subject: [PATCH 3/6] Sonarqube revisions --- .../sonarqube-monitoring-integration.mdx | 470 +++++------------- 1 file changed, 115 insertions(+), 355 deletions(-) diff --git a/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx b/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx index 9b0f50025b8..c515f8b0d83 100644 --- a/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx +++ b/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx @@ -95,14 +95,126 @@ To use the SonarQube integration, you need to first install our PostgreSQL integ insecure_skip_verify: true timeout: 10s ``` + + +## Install and configure the JMX integration -3. Testing to see if this reads as a new step +To use the SonarQube integration, you need to also [install our JMX monitoring integration](/docs/infrastructure/host-integrations/host-integrations-list/jmx-monitoring-install/). The JMX integration scrapes SonarQube data, which we will later turn into dashboards and queryable data. - +1. [Install our JMX monitoring integration](/docs/infrastructure/host-integrations/host-integrations-list/jmx-monitoring-install/). +2. Add the following code snippet to `/opt/sonarqube/conf/sonar.properties`: + ```yml + # SonarQube Web Server JMX configuration. + sonar.web.javaOpts=-Dcom.sun.management.jmxremote \ + -Dcom.sun.management.jmxremote.port=9010 \ + -Dcom.sun.management.jmxremote.authenticate=false \ + -Dcom.sun.management.jmxremote.ssl=false + + # SonarQube Compute Engine JMX configuration. + sonar.ce.javaOpts=-Dcom.sun.management.jmxremote \ + -Dcom.sun.management.jmxremote.port=9011 \ + -Dcom.sun.management.jmxremote.authenticate=false \ + -Dcom.sun.management.jmxremote.ssl=false + ``` +3. Add the following code snippet to `/etc/newrelic-infra/integrations.d/jvm-sonarqube-web-metrics.yml/`: + ```yml + collect: + - domain: SonarQube + event_type: JVMSampleSonarQubeWebMetrics + beans: + - query: name=AsyncExecution + attributes: + - QueueSize + - WorkerCount + - LargestWorkerCount + - query: name=Database + attributes: + - MigrationStatus + - PoolActiveConnections + - PoolMaxActiveConnections + - PoolIdleConnections + - PoolMaxIdleConnections + - PoolMinIdleConnections + - PoolInitialSize + - PoolMaxWaitMillis + - PoolRemoveAbandoned + - PoolRemoveAbandonedTimeoutSeconds + - query: name=SonarQube + attributes: + - Version + - ServerId + - LogLevel + ``` +4. Add the following code snippet to `/etc/newrelic-infra/integrations.d/jvm-sonarqube-compute-engine-metrics.yml`: + + ```yml + collect: + - domain: SonarQube + event_type: JVMSampleSonarQubeComputeEngineMetrics + beans: + - query: name=ComputeEngineDatabaseConnection + attributes: + - PoolInitialSize + - PoolActiveConnections + - PoolMaxActiveConnections + - PoolIdleConnections + - PoolMaxIdleConnections + - PoolMinIdleConnections + - PoolMaxWaitMillis + - PoolRemoveAbandoned + - PoolRemoveAbandonedTimeoutSeconds + - query: name=ComputeEngineTasks + attributes: + - PendingCount + - LongestTimePending + - InProgressCount + - ErrorCount + - SuccessCount + - ProcessingTime + - WorkerMaxCount + - WorkerCount + - WorkerUuids + - EnabledWorkerUuids + ``` + +5. Add the following code snippet to `/etc/newrelic-infra/integrations.d/jmx-sonarqube-compute-engine-config.yml`: + ```yml + integrations: + - name: nri-jmx + env: + COLLECTION_FILES: /etc/newrelic-infra/integrations.d/jmx-sonarqube-web-config.yml + JMX_HOST: + JMX_PASS: admin + JMX_PORT: 9010 + JMX_USER: admin + CONNECTION_URL: service:jmx:rmi://:9010/jndi/rmi://:9010/jmxrmi + REMOTE_MONITORING: "true" + interval: 15s + labels: + env: staging + ``` +6. Add the following code snippet to `/etc/newrelic-infra/integrations.d/jmx-sonarqube-web-config.yml`: + + ```yml + integrations: + - name: nri-jmx + env: + COLLECTION_FILES: /etc/newrelic-infra/integrations.d/jmx-sonarqube-compute-engine-config.yml + JMX_HOST: + JMX_PASS: admin + JMX_PORT: 9011 + JMX_USER: admin + CONNECTION_URL: service:jmx:rmi://:9011/jndi/rmi://:9011/jmxrmi + REMOTE_MONITORING: "true" + interval: 15s + labels: + env: staging + ``` + ## Forward SonarQube logs to New Relic -Follow these steps to forward Envoy logs to New Relic: +Follow these steps to forward SonarQube logs to New Relic: 1. Create a log file named `logging.yml` in the following path: @@ -178,355 +290,3 @@ To learn more about building NRQL queries and generating dashboards, check out t * [Introduction to the query builder](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder) to create basic and advanced queries. * [Introduction to dashboards](/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards) to customize your dashboard and carry out different actions. * [Manage your dashboard](/docs/query-your-data/explore-query-data/dashboards/manage-your-dashboard) to adjust your dashboards display mode, or to add more content to your dashboard. - - -## Install the infrastructure agent [#infra-install] - -You can install the infrastructure agent two different ways: - -* Our [guided install](https://one.newrelic.com/nr1-core?state=4f81feab-35f7-e97e-9903-52510f8542bd) 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](/docs/infrastructure/host-integrations/installation/new-relic-guided-install-overview). -* If you'd rather install our infrastructure agent manually, you can follow a tutorial for manual installation for [Linux](/docs/infrastructure/install-infrastructure-agent/linux-installation/install-infrastructure-monitoring-agent-linux), [Windows](/docs/infrastructure/install-infrastructure-agent/windows-installation/install-infrastructure-monitoring-agent-windows/), or [macOS](/docs/infrastructure/install-infrastructure-agent/macos-installation/install-infrastructure-monitoring-agent-macos/). - -## Install the PostgreSQL - -1. Check out our PostgreSQL agent requirements in our [documentation](/docs/infrastructure/host-integrations/host-integrations-list/postgresql/postgresql-integration/) before installing the agent. -2. Open PostgreSQL Quickstart page [PostgreSQL quickstart installation](https://newrelic.com/instant-observability/postresql). -3. Click **Install now** to start the PostgreSQL quickstart installation. - -## Integrate SonarQube with New Relic [#integrate] - -Below are the two ways which has to be followed to integrate SonarQube with New Relic. -1. nri-prometheus configuration -2. nri-jmx configuration - - - - -1. Create a file named `nri-prometheus-config.yml` using this path: `/etc/newrelic-infra/integrations.d/nri-prometheus-config.yml` -2. Use the below template to update the created file named `nri-prometheus-config.yml`. - - -Avoid using the @ symbol in your sonarqube password. - - -3. Update these fields: - - * cluster_name: `YOUR_DESIRED_CLUSTER_NAME` - - For Example: `sonarqube_metrics_exporter` - * urls: `[“http://user_name:password@YOUR_HOST_IP:9000/api/monitoring/metrics”]` - * Insecure_skip_verify: `true` - -Your `nri-prometheus-config.yml` file should look like this: - -```yml ---- -integrations: - - name: nri-prometheus - config: - # When standalone is set to false nri-prometheus requires an infrastructure agent to work and send data. Defaults to true - standalone: false - - # When running with infrastructure agent emitters will have to include infra-sdk - emitters: infra-sdk - - # The name of your cluster. It's important to match other New Relic products to relate the data. - cluster_name: "YOUR_DESIRED_CLUSTER_NAME" - - targets: - - description: Sonarqube metrics list - urls: ["http://user_name:password@YOUR_HOST_IP:9000/api/monitoring/metrics"] - - # tls_config: - # ca_file_path: "/etc/etcd/etcd-client-ca.crt" - # cert_file_path: "/etc/etcd/etcd-client.crt" - # key_file_path: "/etc/etcd/etcd-client.key" - - # Whether the integration should run in verbose mode or not. Defaults to false - verbose: false - - # Whether the integration should run in audit mode or not. Defaults to false. - # Audit mode logs the uncompressed data sent to New Relic. Use this to log all data sent. - # It does not include verbose mode. This can lead to a high log volume, use with care - audit: false - - # The HTTP client timeout when fetching data from endpoints. Defaults to 30s. - # scrape_timeout: "30s" - - # Length in time to distribute the scraping from the endpoints - scrape_duration: "5s" - - # Number of worker threads used for scraping targets. - # For large clusters with many (>400) endpoints, slowly increase until scrape - # time falls between the desired `scrape_duration`. - # Increasing this value too much will result in huge memory consumption if too - # many metrics are being scraped. - # Default: 4 - # worker_threads: 4 - - # Whether the integration should skip TLS verification or not. Defaults to false - insecure_skip_verify: true - timeout: 10s -``` - - - -### 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](/docs/infrastructure/host-integrations/host-integrations-list/jmx-monitoring-install/) integration. You'll need to make some additional configurations once it's installed. - -Example: `sudo apt-get install nri-jmx` - - - - -1. Go to sonar.properties file located in the below path: -```shell -cd /opt/sonarqube/conf -``` -2. Add the below snippet in the `sonar.properties` file to configure the `jmx sonarqube web`. - -```yml -# SonarQube Web Server JMX configuration. - sonar.web.javaOpts=-Dcom.sun.management.jmxremote \ - -Dcom.sun.management.jmxremote.port=9010 \ - -Dcom.sun.management.jmxremote.authenticate=false \ - -Dcom.sun.management.jmxremote.ssl=false -``` -3. Add the below snippet in the `sonar.properties` file to configure the `jmx sonarqube compute engine`. -```yml -# SonarQube Compute Engine JMX configuration. - sonar.ce.javaOpts=-Dcom.sun.management.jmxremote \ - -Dcom.sun.management.jmxremote.port=9011 \ - -Dcom.sun.management.jmxremote.authenticate=false \ - -Dcom.sun.management.jmxremote.ssl=false -``` - - - - -1. Open your jconsole by using the command `jconsole` -2. Click on remote connection and use the below connection urls to connect your SonarQube domain. - -Example: - -`service:jmx:rmi://[YOUR_HOST]:9010/jndi/rmi://[YOUR_HOST]:9010/jmxrmi` -`service:jmx:rmi://[YOUR_HOST]:9011/jndi/rmi://[YOUR_HOST]:9011/jmxrmi` - -3. Go to the MBeans tab in your jconsole tool and you can able to see the SonarQube JVM metrics. - - - - -This step organizes your metrics to be human readable once they're in New Relic. Update the `jvm-sonarqube-web-metrics.yml` and `jvm-sonarqube-compute-engine-metrics.yml` files with any metrics that jconsole should capture. In the procedure below is the snippet of the jvm-metrics.yml file. - -Before you start, here are some things to know about using the snippet: -- For the code snippet below, you'll update it with your desired metrics. -- Update `YOUR_BROKER_NAME`,` YOUR_TOPIC_NAME`, and `YOUR_QUEUE_NAME` with your actual values. You can use the jconsole tool to get these values. -- All the metrics captured are stored on the events determined by the event_type field. - -To update the `jvm-metrics` files: - -1. Go to the below file path. -```shell -cd /etc/newrelic-infra/integrations.d/ -``` -2. Create the `jvm-sonarqube-web-metrics.yml` and `jvm-sonarqube-compute-engine-metrics.yml` files. -3. Add the below snippet to our `jvm-sonarqube-web-metrics.yml` file: -```yml -collect: - - domain: SonarQube - event_type: JVMSampleSonarQubeWebMetrics - beans: - - query: name=AsyncExecution - attributes: - - QueueSize - - WorkerCount - - LargestWorkerCount - - query: name=Database - attributes: - - MigrationStatus - - PoolActiveConnections - - PoolMaxActiveConnections - - PoolIdleConnections - - PoolMaxIdleConnections - - PoolMinIdleConnections - - PoolInitialSize - - PoolMaxWaitMillis - - PoolRemoveAbandoned - - PoolRemoveAbandonedTimeoutSeconds - - query: name=SonarQube - attributes: - - Version - - ServerId - - LogLevel -``` -4. Add the below snippet to our `jvm-sonarqube-compute-engine-metrics.yml` file: -```yml -collect: - - domain: SonarQube - event_type: JVMSampleSonarQubeComputeEngineMetrics - beans: - - query: name=ComputeEngineDatabaseConnection - attributes: - - PoolInitialSize - - PoolActiveConnections - - PoolMaxActiveConnections - - PoolIdleConnections - - PoolMaxIdleConnections - - PoolMinIdleConnections - - PoolMaxWaitMillis - - PoolRemoveAbandoned - - PoolRemoveAbandonedTimeoutSeconds - - query: name=ComputeEngineTasks - attributes: - - PendingCount - - LongestTimePending - - InProgressCount - - ErrorCount - - SuccessCount - - ProcessingTime - - WorkerMaxCount - - WorkerCount - - WorkerUuids - - EnabledWorkerUuids -``` - - - - -The below YAML snippet connects your SonarQube metrics via `CONNECTION_URL` to jconsole, a Java tool that makes those metrics readable. If you're following along with the JMX integration install, this step corresponds with the configuration step. - -To update: - -1. Go to the file path below: -```shell -cd /etc/newrelic-infra/integrations.d/ -``` -2. Create the `jmx-sonarqube-web-config.yml` and `jmx-sonarqube-compute-engine-config.yml` files. -3. Add the following snippet to your `jmx-sonarqube-web-config.yml` file for the SonarQube Web server. - -```yml -integrations: - - name: nri-jmx - env: - COLLECTION_FILES: /etc/newrelic-infra/integrations.d/jmx-sonarqube-web-config.yml - JMX_HOST: - JMX_PASS: admin - JMX_PORT: 9010 - JMX_USER: admin - CONNECTION_URL: service:jmx:rmi://:9010/jndi/rmi://:9010/jmxrmi - REMOTE_MONITORING: "true" - interval: 15s - labels: - env: staging -``` -4. Add the following snippet to your `jmx-sonarqube-compute-engine-config.yml` file for the SonarQube Compute Engine. - -```yml -integrations: - - name: nri-jmx - env: - COLLECTION_FILES: /etc/newrelic-infra/integrations.d/jmx-sonarqube-compute-engine-config.yml - JMX_HOST: - JMX_PASS: admin - JMX_PORT: 9011 - JMX_USER: admin - CONNECTION_URL: service:jmx:rmi://:9011/jndi/rmi://:9011/jmxrmi - REMOTE_MONITORING: "true" - interval: 15s - labels: - env: staging -``` - - - -## Forward SonarQube logs to New Relic - -You can use our [log forwarding](/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent/) to forward SonarQube logs to New Relic. - -On Linux machines, your log file named `logging.yml` should be present in this path: - -```shell -cd /etc/newrelic-infra/logging.d/ -``` -After creating the log file, add the following script to the `logging.yml` file: - -```yml -logs: - - name: sonar_logs - file: /opt/sonarqube/logs/sonar.log - attributes: - logtype: sonar_logs - - name: ce_logs - file: /opt/sonarqube/logs/ce.log - attributes: - logtype: sonar_ce_logs - - name: es_logs - file: /opt/sonarqube/logs/es.log - attributes: - logtype: sonar_es_logs - - name: web_logs - file: /opt/sonarqube/logs/web.log - attributes: - logtype: sonar_web_logs -``` - -## Restart the New Relic infrastructure agent - -Restart your infrastructure agent. - -```shell -sudo systemctl restart newrelic-infra.service -``` - -In a couple of minutes, your application will send metrics to [one.newrelic.com](https://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](https://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](/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards). - -Here is a NRQL query to check your SonarQube web status: - -```sql -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: - -```sql -SELECT latest(PoolIdleConnections) FROM JVMSampleSonarQubeWebMetrics -``` - -## What's next? - -To learn more about building NRQL queries and generating dashboards, check out these docs: - -* [Introduction to the query builder](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder) to create basic and advanced queries. -* [Introduction to dashboards](/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards) to customize your dashboard and carry out different actions. -* [Manage your dashboard](/docs/query-your-data/explore-query-data/dashboards/manage-your-dashboard) to adjust your dashboards display mode, or to add more content to your dashboard. From 4d47753fc4c71494e4339c4dfef8069b3bbb9e05 Mon Sep 17 00:00:00 2001 From: Bradley Camacho Date: Mon, 1 Apr 2024 09:30:10 -0700 Subject: [PATCH 4/6] Apply feedback --- .../sonarqube-monitoring-integration.mdx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx b/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx index c515f8b0d83..cb7f509fad0 100644 --- a/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx +++ b/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx @@ -25,14 +25,16 @@ After setting up our SonarQube integration, we give you a dashboard for your Son ## Install the infrastructure agent [#infra-install] -To use the SonarQube integration, you need to also [install the infrastructure agent](/docs/infrastructure/install-infrastructure-agent/get-started/install-infrastructure-agent-new-relic/) on the same host. The infrastructure agent monitors the host itself, while the integration you'll install in the next step extends your monitoring with SonarQube-specific data. +To use the SonarQube integration, you need to first [install the infrastructure agent](/docs/infrastructure/install-infrastructure-agent/get-started/install-infrastructure-agent-new-relic/) on the same host. All our on-host integrations require the infrastructure agent, which helps expose and report metrics to New Relic. + +To use the Apache Druid integration, monitoring with data specific to your Druid clusters. ## Install the PostgreSQL integration To use the SonarQube integration, you need to first install our PostgreSQL integration. -1. Check out our PostgreSQL integration requirements in our [documentation](/docs/infrastructure/host-integrations/host-integrations-list/postgresql/postgresql-integration/) before installing the integration. +1. Check out our PostgreSQL integration requirements in our [documentation](/docs/infrastructure/host-integrations/host-integrations-list/postgresql/postgresql-integration/) before installing the integration. Confirm your compatibility, then return to this doc. 2. Open PostgreSQL Quickstart page [PostgreSQL quickstart installation](https://newrelic.com/instant-observability/postresql). 3. Click **Install now** to start the PostgreSQL quickstart installation. @@ -45,7 +47,7 @@ To use the SonarQube integration, you need to first install our PostgreSQL integ ```shell touch /etc/newrelic-infra/integrations.d/nri-prometheus-config.yml ``` -2. Paste the following snippet into the new config file. Be sure to update the `cluster_name` and `urls` fields: +2. Paste the following snippet into the new config file. Be sure to update the `cluster_name` and `urls` with your relevant fields: ```yml integrations: @@ -58,7 +60,7 @@ To use the SonarQube integration, you need to first install our PostgreSQL integ emitters: infra-sdk # The name of your cluster. It's important to match other New Relic products to relate the data. - cluster_name: "YOUR_DESIRED_CLUSTER_NAME" + cluster_name: "YOUR_CLUSTER_NAME" targets: - description: Sonarqube metrics list From 01591cdb6f2821d809851bbc5845aac620b89263 Mon Sep 17 00:00:00 2001 From: Bradley Camacho Date: Mon, 1 Apr 2024 10:09:10 -0700 Subject: [PATCH 5/6] Styling edits --- .../sonarqube-monitoring-integration.mdx | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx b/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx index cb7f509fad0..ebf0debdb81 100644 --- a/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx +++ b/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx @@ -25,9 +25,7 @@ After setting up our SonarQube integration, we give you a dashboard for your Son ## Install the infrastructure agent [#infra-install] -To use the SonarQube integration, you need to first [install the infrastructure agent](/docs/infrastructure/install-infrastructure-agent/get-started/install-infrastructure-agent-new-relic/) on the same host. All our on-host integrations require the infrastructure agent, which helps expose and report metrics to New Relic. - -To use the Apache Druid integration, monitoring with data specific to your Druid clusters. +To use the SonarQube integration, you need to first [install the infrastructure agent](/docs/infrastructure/install-infrastructure-agent/get-started/install-infrastructure-agent-new-relic/) on the same host. All our on-host integrations require the infrastructure agent, which helps expose and report metrics to New Relic. ## Install the PostgreSQL integration @@ -249,7 +247,7 @@ Follow these steps to forward SonarQube logs to New Relic: ## Restart the New Relic infrastructure agent -Restart your infrastructure agent. +Restart your infrastructure agent: ```shell sudo systemctl restart newrelic-infra.service @@ -262,26 +260,34 @@ 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: -1. From [one.newrelic.com](https://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. + 1. From [one.newrelic.com](https://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](/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards). -Here is a NRQL query to check your SonarQube web status: - +Here's a few example NRQL queries for Postfix data: + + ```sql 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: - + + ```sql SELECT latest(PoolIdleConnections) FROM JVMSampleSonarQubeWebMetrics ``` - + + From 803c65ef106935e719efcad84a1b102b541d7f13 Mon Sep 17 00:00:00 2001 From: Bradley Camacho Date: Mon, 1 Apr 2024 10:13:42 -0700 Subject: [PATCH 6/6] Fix broken MDX --- .../sonarqube-monitoring-integration.mdx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx b/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx index ebf0debdb81..be5cc667175 100644 --- a/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx +++ b/src/content/docs/infrastructure/host-integrations/host-integrations-list/sonarqube-monitoring-integration.mdx @@ -268,24 +268,29 @@ You can choose our pre-built dashboard template named `SonarQube` to monitor you 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](/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards). Here's a few example NRQL queries for Postfix data: + -```sql -SELECT latest(sonarqube_web_uptime_minutes) -AS 'SonarQube Web Uptime (minutes)' -FROM Metric -``` + + ```sql + SELECT latest(sonarqube_web_uptime_minutes) + AS 'SonarQube Web Uptime (minutes)' + FROM Metric + ``` + + ```sql SELECT latest(PoolIdleConnections) FROM JVMSampleSonarQubeWebMetrics ``` +