Setup sonarqube to export prometheus metrics

Hello,

I would like to setup sonar to export prometheus metrics like project analysis results, score for reliability, for Security, …

Is-it possible out of the box ? With my current version ? With an external plugin ? With a newest version of the product ?

  • Version of SonarQube : `Developer Edition Version 9.9 (build 65466)`
  • Deployed with zip

Regards,

Hey @smutel,

SonarQube 9.9 features built-in Prometheus integration that exposes instance-level metrics from /api/monitoring/metrics in OpenMetrics format. This works for a ZIP install too.

However, the metrics exposed there are focused on the health and behavior of the instance and don’t include per-project metrics of any type. For those, there is currently no SonarSource-provided Prometheus exporter. The supported approach is to query the Web APIs (see your in-product API docs) from your own exporter or scheduled job and publish them as custom Prometheus metrics.

If you don’t want to code this exporter yourself, there might be some community-developed exporters out there (https://github.com/DomGiorda/sonar-metrics-exporter has been brought up in the past by some users) but please note these are not developed or supported by us.