Release validation
With Cloud Automation, you can use quality gates to automatically validate your builds, deployments, and releases based on service-level objectives (SLOs). Cloud Automation quality gates are based on Keptn, a Cloud Native Computing Foundation open-source project.
Quality gates are benchmarks in the software delivery lifecycle that define specific, measurable, and achievable success criteria that a service must meet before it is advanced to the next phase of the software delivery pipeline. Quality gates can validate any service-level objective (SLO), giving you the ability to ensure automated and consistent evaluation of software quality.
Establishing clear, consistent, and effective quality gates that are automatically validated at each phase of the delivery pipeline is essential for improving software quality and speeding up delivery.
Dynatrace Cloud Automation is licensed based on the consumption of Cloud Automation units (CAUs). For details, see Cloud Automation monitoring (CAUs).
Prerequisites
Connect a service with quality gates
To enable Cloud Automation quality gates for a specific Dynatrace-monitored service, you need to connect your service with quality gates by adding two specific tags (keptn_managed
and keptn_service
) to the service in Dynatrace.
Note: The following steps describe how you can define those tags manually. To automate this process, you can also use auto-tagging rules or the DT_TAGS
environment variable.
- In the Dynatrace menu, go to Services and select the service you want to connect with Cloud Automation quality gates.
- Expand Properties and tags.
- Select Add tag and enter these two tags:
- Key:
keptn_managed
. - Key:
keptn_service
; Value:<your_service_name>
.
- Key:
Note: When entering the value, be sure you use lowercase and that there are no spaces between words or special characters.
For more information about tagging, see Best practices and recommendations for tagging.
View Dynatrace services in the Cloud Automation bridge
After adding the keptn_managed
and keptn_service
tags to your service, the service will show up in the Cloud Automation bridge.
To view the service
- Sign in to the Cloud Automation bridge.
- Select the Dynatrace project.
- Select the Services button.
Note: Automatic synchronization takes place every minute.
Trigger quality gate evaluations
After connecting your Dynatrace-monitored service with Cloud Automation quality gates, you can trigger quality gate evaluations.
How the evaluation works:
Cloud Automation queries service-level indicators from Dynatrace and compares them against service-level objectives. If the objectives are met, the quality gate evaluation is succeeded
. Otherwise, the evaluation is failed
.
Note: Cloud Automation quality gate automates the validation of different software versions or builds. To evaluate different software versions or builds, you can run multiple quality gates.
You have two options to trigger a quality gates evaluation: in the Keptn CLI or using the REST API.
Run the command below, making sure to replace
<your_service_name>
with your service name<your_service_build_number>
with the service build number you want to evaluate<evaluation_timeframe>
with the desired evaluation timeframe
keptn trigger evaluation --project=dynatrace --stage=quality-gate --service=<your_service_name> --timeframe=<evaluation_timeframe> --labels=buildId=<your_service_build_number>,executedBy=manual
Example command:
keptn trigger evaluation --project=dynatrace --stage=quality-gate --service=iampapservice --timeframe=30m --labels=buildId=1,executedBy=manual
In the example above, we're triggering a quality gate evaluation of build 1
of your IAM PAP Service
service running in the quality-gate
stage of your dynatrace
project during a 30-minute timeframe.
To compare between two builds, you can trigger another evaluation. Run the same command, replacing the buildID
value with the desired value.
For more information on the concepts of project
, stage
, and service
in the Cloud Automation context, see Definition of project, stage, and service.
Alternatively, you can trigger an evaluation quality gate using the REST API.
-
In the Cloud Automation bridge, open the user menu in the upper-right corner.
-
Select Keptn API to open the Cloud Automation Swagger UI.
-
In Select a definition, select controlPlane.
-
Authenticate with your API token. See Dynatrace requirements for details.
-
Scroll down to Evaluation and select POST.
-
In Parameters, select Try out.
-
Enter the details as below:
- For Project, enter
dynatrace
- For Stage, enter
quality-gate
- For Service, enter your service name, making sure you use lowercase and that there are no spaces between words or special characters.
- For Evaluation, enter
{ "labels": { "executedBy": "api", "buildId": "<your_service_build_number>" }, "timeframe": "<evaluation_timeframe>" }
Note: Be sure to replace
<your_service_build_number>
and<evaluation_timeframe>
with your own values. - For Project, enter
-
Select Execute.
To compare between two builds, you can trigger another evaluation. Follow the same steps again, replacing the buildID
value with the desired value.
For more information on the concepts of project
, stage
, and service
in the Cloud Automation context, see Definition of project, stage, and service.
Note: To learn how to set up SLOs and SLIs on your Dynatrace-monitored service for which you want to run quality gates evaluations, see Service-level objectives and Service-level indicators.
View quality gate evaluation results
After running the quality gate evaluation, you can view evaluation results on the Cloud Automation bridge in Services. When you select a service, a heatmap and a chart appear on the evaluation board, displaying the evaluation comparison for the quality-gate
stage.
For more information, see Services view.
Additional resources
For additional insights into Dynatrace quality gates, check our Dynatrace University tutorials: