Dynatrace: Leverage Dynatrace AIOps in GitHub CI pipelines to prevent critical incidents

The newly released Dynatrace GitHub action allows DevOps teams to take full advantage of all observable information available from CI pipelines. By leveraging CI pipeline information within your observability platform, your DevOps teams can closely monitor the health of all pipelines and react faster when critical incidents are detected. This greatly facilitates the detection and resolution of deployment failures.

GitHub Actions offers a great way to automate, customize, and execute your software development workflows. A fully automated software release pipeline helps you release new features faster and frees up valuable development resources to focus on innovation. GitHub workflows can be quite complex, running dozens of individual build, test, and deploy steps. By dropping a GitHub Dynatrace action into your GitHub CI/CD workflow, you get real-time observability and insights into your pipeline performance. CI/CD workflow feedback helps your DevOps teams quickly find faulty software deployments and react quickly to prevent and fix critical failures.

What is a GitHub Action?

GitHub actions are configurable workflow steps that can be used to perform any type of automation task. Examples of such automation tasks include pulling a repository, building software, signing the resulting binary, and finally copying and deploying the resulting software artifacts to a cloud runtime environment.

A series of such actions can be combined into a GitHub workflow that can be triggered whenever new code is committed or when a new release tag is pushed to a repository. Several GitHub actions are available on the GitHub Marketplace:

Using GitHub workflows is simple because their configurations are stored in your GitHub repository.

With a single click, you can select a GitHub action that starts creating a Docker container from your repository and automatically deploys the resulting image to Docker Hub. The workflow is configured to run automatically whenever a push or pull request is made on the master branch, or when the workflow is triggered manually.

As you can see below, all you need to automatically build and deploy a container to Docker Hub is a 40-line YAML workflow configuration file:

Dynatrace Action GitHub

The specially designed Dynatrace GitHub action is available on the GitHub Marketplace under the monitoring category. This is useful for transparently observing all your GitHub workflows. Simply drag and drop the Dynatrace action into your CI pipeline and collect all your relevant metrics and events during each of the execution steps.

This GitHub action is part of the Dynatrace Open-Source initiative, which maintains and contributes to many open-source projects.

What is the value of observing your CI/CD pipeline in Dynatrace?

Collecting information about your CI/CD pipeline has many benefits. Collecting statistics on the execution of your build and deployment automation workflow helps you assess the overall quality of your pipeline.

Counting the number of failing builds against the number of successful builds helps you understand why and when code commits break your pipeline. Counting the number of failing integration tests helps inform responsible development teams quickly so they can prevent critical issues from reaching production.

A service level objective (SLO) can be set to help you track the quality of your build and test pipeline, as shown below:

By closely monitoring the health of your CI/CD pipeline in Dynatrace, you can react quickly if the quality of pushed code declines.

Integrate workflow information into Dynatrace Davis root cause detection

In addition to continuously collecting status information from all your build pipelines, it’s also crucial that you have the ability to quickly identify when a faulty deployment is causing a large-scale production failure.

By seamlessly feeding your pipeline health metrics and event information back to your Dynatrace monitoring environment, Dynatrace Davis AIOps can retrieve and assess this information in the event of detected incidents.

One use case is to send all relevant deployments to the monitoring platform and attach this information to all relevant departments. Below you can see a Dynatrace GitHub action configuration that counts the number of failed and successful builds. The action sends a deployment event to Dynatrace with each pipeline run.

Each of the runs now automatically notifies Dynatrace of the new deployment, attaching the information to all services named ‘loginService’. The relevant information is then displayed on the service overview page in the Dynatrace web UI. In the event of an incident, the Davis AIOps engine automatically retrieves the metric and identifies the deployment event as the root cause of the issue.

See the example below that shows Davis AIOps has identified a new service deployment triggered by the GitHub CI pipeline as the root cause of a production slowdown.

New to Dynatrace?

If you haven’t used Dynatrace yet, give it a try by starting your free Dynatrace trial today.