Integrate SonarQube with ELK stack

My organization is using SonarQube 8.9.6 CE

We want to consume project and analysis data to build dashboards with it.
We were leveraging the REST API but we found that the only endpoint that returns all the project keys on a SQ instance (api/projects/search) requires Administer Privileges.

We would like to access data without using the REST API and we were thinking of ingesting Sonar analysis logs into an Elastic database.

Is this possible? Is there an integration between SonarQube and Elastic we could use to ingest tha data?

Hey there.

For what it’s worth – GET api/components/search_projects will also return a list of project keys that the user making the API call has access to (based on the permissions assigned to that user).

You won’t be able to get much information from analysis logs as those logs only have factual details about the analysis rather than the measures/issues (which are sent to the SoanrQube server for processing).

Out of curiosity, what kind of dashboards are you looking to build that aren’t available in SonarQube out-of-the-box?

Hi Colin :wave:t3:

My use case requires me to find projects with the same project name but different project keys and pick the last analysed one. I wanted to use api/projects/search because it contains the last analysis date for each project.

We are building a custom visualisation that condenses Sonar quality metrics with other metrics coming from other services/servers. We want to display everything on the same place.

GET api/components/search_projects also returns analysisDate as long as you include f=analysisDate as a query parameter.

See an API call like this:

https://next.sonarqube.com/sonarqube/api/components/search_projects?ps=50&facets=reliability_rating,security_rating,security_review_rating,sqale_rating,coverage,duplicated_lines_density,ncloc,alert_status,languages,tags,qualifier&f=analysisDate,leakPeriodDate&s=coverage&asc=false

1 Like

Did anyone ever mentioned HOW AWESOME YOU ARE?

Thanks for the help!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.