With the introduction of CQL reports, Cortex gives you more visibility than ever before. Up until now, CQL and reports have been relatively binary. Although CQL gives you the power to traverse your data with flexibility, it’s been constrained to true/false, yes/no answers.
With CQL reports, we’ve made CQL more responsive: your report columns, which would ordinarily be scorecard rules, are based on CQL expressions instead. Let’s say, for example, you have sonarqube(“coverage”) >= 0.9 as a scorecard rule. In a report for that scorecard, your rule would be a column, and in each cell you’d see whether the service or resource has at least 90% code coverage.
But what if you wanted to see the exact code coverage for each service or resource? With CQL reports, you can query that data and return SonarQube coverage metrics for each entity within the cells. With CQL reports, you can not only query all of the raw data in Cortex, but you can build a custom report on top of it, unlocking greater visibility into your components’ performance.
Creating a CQL report
When creating a CQL report, you have the option to use a CQL report template or Start from scratch. If you opt to work from a template, you’ll be able to select from any of your organization’s available templates, making it easier to be sure all best practices are being followed.
Regardless of which option you choose, you’ll then be prompted to enter a name and description for your report, so you can tell at a glance what each report is querying. You can also choose to filter your CQL report at this stage so that it only applies to specific services. That may come in handy if you only want to examine tier-1 services or frontend libraries, for example.
From there, you’ll define the CQL expressions that will serve as your report columns. Select Add column to define a new expression, or use the pencil icon to edit an existing column.
Once each expression is saved, Cortex will run the query to generate results for that column. Queries run asynchronously, so the report will generate cell by cell to pull the specific values for each entity.
Note: The same permissions that apply to the query builder apply to CQL reports. Only managers and admins have the ability to run reports that include third-party integrations.
Output cell values can be any type — they can be strings, numbers, booleans, or whatever else you want. Note that if the return value is too large (like a 5 MB JSON file) the cell will error out, so we recommend defining raw values for outputs.
As the queries run, you can access results and watch progress as it completes. Just like with the query builder, Cortex won’t automatically refresh queries, but you can manually refresh at any time.
During the creation flow, you also have the option to make your CQL report Public by switching the toggle below Save CQL report.
If you choose to keep the CQL report private, you’ll be the only user able to see the report. Just like with the query builder, public CQL reports will be available to everyone in your organization, so you can easily share your insights with others.
You can return at any point to reconfigure your CQL report, including changing its public/private status.
Comments
0 comments
Article is closed for comments.