Sonarqube integration with Prometheus📜
Sonarqube does not have built-in support for a /metrics endpoint for Prometheus integration. A metrics exporter plugin is required.
Summary (Scenario)📜
This Prometheus.md document is a quick guide on how to setup Prometheus montoring to scrape metrics from Sonarqube. These instructions have been written for running Big Bang on a dev-cluster (dev.bigbang.mil). If you are in an airgapped environment these instructions can be used as guidance but may need to be altered.
Resources📜
values.yaml📜
The below additional values need to be added to your existing values.yaml file in order for integrating the prometheus exporter.
- Some sections will needed to be changed for your kubernetes cluster.
monitoring:
enabled: true
prometheusExporter:
enabled: true
version: "1.0.1"
webBeanPort: 8000
ceBeanPort: 8001
config:
rules:
- pattern: ".*"
image: registry1.dso.mil/ironbank/opensource/prometheus/jmx-exporter:1.0.1
monitoringPasscode: "define_it" # set this password to your instance admin password used for the UI
networkPolicies:
enabled: true # enable during validation to verify Prometheus scraping works with NetworkPolicies applied
service:
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: ""
prometheus.io/path: "/metrics"
istio:
enabled: true
hardened:
enabled: true
monitoring:
enabled: true
- Navigate to the Prometheus target page (https://prometheus.dev.bigbang.mil/targets) and validate that the Sonarqube target shows as up.
Troubleshooting📜
- With monitoring enabled it takes Sonarqube about 15 to 20 minute to fully come up to ready.
- Kiali can be used to monitor istio policies for the monitoring and sonarqube namespaces.