SonarQube Metrics For Monitoring

Im Using SonarQube 9.9.1 LTS On Ubuntu 20.04
SonarQube Is Working Fine.
By default sonarqube exposes an endpoint of /api/monitoring/metrics for monitoring.
but, few days back when i checked that particular endpoint then i got all the metrics visible. but when i try to check today. only few metrics are visible.

# HELP sonarqube_health_integration_gitlab_status Tells whether SonarQube instance has configured GitLab integration and its status is green. 1 for green, 0 otherwise .
# TYPE sonarqube_health_integration_gitlab_status gauge
sonarqube_health_integration_gitlab_status 0.0
# HELP sonarqube_health_integration_bitbucket_status Tells whether SonarQube instance has configured BitBucket integration and its status is green. 1 for green, 0 otherwise .
# TYPE sonarqube_health_integration_bitbucket_status gauge
sonarqube_health_integration_bitbucket_status 0.0
# HELP sonarqube_health_compute_engine_status Tells whether Compute Engine is up (healthy, ready to take tasks) or down. 1 for up, 0 for down
# TYPE sonarqube_health_compute_engine_status gauge
sonarqube_health_compute_engine_status 1.0
# HELP sonarqube_license_days_before_expiration_total Days until the SonarQube license will expire.
# TYPE sonarqube_license_days_before_expiration_total gauge
sonarqube_license_days_before_expiration_total 0.0
# HELP sonarqube_number_of_connected_sonarlint_clients Number of connected SonarLint clients
# TYPE sonarqube_number_of_connected_sonarlint_clients gauge
sonarqube_number_of_connected_sonarlint_clients 0.0
# HELP sonarqube_compute_engine_pending_tasks_total Number of tasks at given point of time that were pending in the Compute Engine queue [SHARED, same value for every SonarQube instance]
# TYPE sonarqube_compute_engine_pending_tasks_total gauge
sonarqube_compute_engine_pending_tasks_total 0.0
# HELP sonarqube_health_integration_github_status Tells whether SonarQube instance has configured GitHub integration and its status is green. 1 for green, 0 otherwise .
# TYPE sonarqube_health_integration_github_status gauge
sonarqube_health_integration_github_status 0.0
# HELP sonarqube_health_integration_azuredevops_status Tells whether SonarQube instance has configured Azure integration and its status is green. 1 for green, 0 otherwise .
# TYPE sonarqube_health_integration_azuredevops_status gauge
sonarqube_health_integration_azuredevops_status 0.0
# HELP sonarqube_compute_engine_tasks_running_duration_seconds Compute engine task running time in seconds
# TYPE sonarqube_compute_engine_tasks_running_duration_seconds summary
# HELP sonarqube_health_elasticsearch_status Tells whether Elasticsearch is up or down. 1 for Up, 0 for down
# TYPE sonarqube_health_elasticsearch_status gauge
sonarqube_health_elasticsearch_status 1.0
# HELP sonarqube_elasticsearch_disk_space_total_bytes Total disk space on the device
# TYPE sonarqube_elasticsearch_disk_space_total_bytes gauge
sonarqube_elasticsearch_disk_space_total_bytes{node_name="sonarqube",} 5.2521566208E10
# HELP sonarqube_health_web_status Tells whether Web process is up or down. 1 for up, 0 for down
# TYPE sonarqube_health_web_status gauge
sonarqube_health_web_status 1.0
# HELP sonarqube_license_number_of_lines_analyzed_total Number of lines analyzed.
# TYPE sonarqube_license_number_of_lines_analyzed_total gauge
sonarqube_license_number_of_lines_analyzed_total 0.0
# HELP sonarqube_elasticsearch_disk_space_free_bytes Space left on device
# TYPE sonarqube_elasticsearch_disk_space_free_bytes gauge
sonarqube_elasticsearch_disk_space_free_bytes{node_name="sonarqube",} 3.0632742912E10
# HELP sonarqube_license_number_of_lines_remaining_total Number of lines remaining until the limit for the current license is hit.
# TYPE sonarqube_license_number_of_lines_remaining_total gauge
sonarqube_license_number_of_lines_remaining_total 0.0
# HELP sonarqube_web_uptime_minutes Number of minutes for how long the SonarQube instance is running
# TYPE sonarqube_web_uptime_minutes gauge
sonarqube_web_uptime_minutes 569.0

Can someone help me in resolving this issue ?


It’s not clear what you think is missing.


Hi Ann,

Like Whenever A Project Is available in sonarqube projects dashboard, then all the metrics of those projects should also be visible right? at api/monitoring/metrics endpoint !!
like code quality, code coverage, code smells, bugs, vulnerabilities, lines of code, total number of issues,duplicated lines, memory usage, disk space, …

Any Help ?


You might want to check the FAQ. Specifically:

I created a topic, when can I expect a response?

This is an open community with people volunteering their free time to provide assistance. We’re eager to contribute to the community, but you are not guaranteed a fast response.

Be patient

  • Wait a few days before bumping a topic that hasn’t received a response.

Regarding your question, that endpoint returns monitoring metrics, not project metrics, as demonstrated in the sample response in the web API docs


Then How to get project metrics aswell ?


Have you tried this via the UI? The best way to master the API is to perform the desired action via the UI and eavesdrop to see which calls the UI made to accomplish the action.

You may also find this guide helpful.