Get started with Cloud Automation quality gates

What are quality gates?

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.

How to get started

To start working with Cloud Automation quality gates, you need to first integrate your Cloud Automation instance into your Dynatrace environment. Then you can enable Cloud Automation quality gates for a specific Dynatrace-monitored service. After connecting your service with quality gates, you can trigger quality gate evaluations. See below for instructions.

Consult the Prerequisites for Cloud Automation quality gates for a list of requirements for this integration.

Integrate Cloud Automation into Dynatrace

To integrate your Cloud Automation into Dynatrace, you need to authenticate against the Cloud Automation cluster, and then connect your Cloud Automation instance with your Dynatrace environment through a token secret.

1. Authenticate

To authenticate against the Cloud Automation cluster

  1. Sign in to the Cloud Automation bridge.
  2. Select the Dynatrace project.
  3. Open the user menu in the upper-right corner.
  4. In the keptn auth command field, select the Copy button.
  5. Paste and run the authentication command in the Keptn CLI.

Example command:

keptn auth --endpoint=https://<your_Cloud_Automation_URL>/api --api-token=<your_Cloud_Automation_API_token>

2. Connect Cloud Automation to Dynatrace

You have two options to connect your Cloud Automation instance with your Dynatrace environment: via the Cloud Automation bridge or via the Keptn CLI.

  1. Go to your Dynatrace project.
  2. In the menu on the left side of the page, select the Uniform button.
  3. Select Secrets.
  4. Select Add secret.
  5. Enter a name for your secret (the default is dynatrace), and the key/value pairs below.
    Key Value
    DT_TENANT Your Dynatrace environment ID.
    DT_API_TOKEN Your Dynatrace API token. See Dynatrace requirements for details.
  6. For Scope, select dynatrace-service.
  7. Select Add secret to save your configuration.

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.

  1. In the Dynatrace menu, go to Services and select the service you want to connect with Cloud Automation quality gates.
  2. Expand Properties and tags.
  3. Select Add tag and enter these two tags:
    • Key: keptn_managed.
    • Key: keptn_service; Value: <your_service_name>.

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 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

  1. Sign in to the Cloud Automation bridge.
  2. Select the Dynatrace project.
  3. 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.

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: