Defining metric thresholds and alerts
To further streamline and automate quality inspection, Sonar introduces dynamic threshold alerts by assigning threshold values to specific metrics. Whenever a metric exceeds the configured value or threshold, an alert is raised. Alerted projects are specifically marked both in the projects list and in the dashboard to indicate the threshold violation.
Each quality profile features its own separate set of alerts. Next, we will add two alerts to Rules compliance and Testing Coverage. Click on Configuration, go to the Quality Profiles page, and click on the Packt profile we have already created (if you haven't created it, simply create a new one by clicking on Copy to copy the default profile, named Sonar way). Then, click on the Alerts tab to navigate to the Alerts management screen.
To create an alert, we need to define:
The metric the threshold applies to
Compare type: is greater than, is less than, equals, is not
The Warning alert threshold: When this...