Every deployment is a risk.
The faster you know whether a release meets your reliability objectives, the faster you can act, and promote with confidence or roll back before users are affected.
This tutorial shows you how to automate that decision using
Workflows, Site Reliability Guardian, and SDLC events, or Business events.
Dynatrace recommends using SDLC events to implement the release validation use case. Business events are also supported.
This tutorial is for DevOps engineers, platform engineers, and site reliability engineers who want to automate release validation within a CI/CD pipeline. It assumes you manage deployment pipelines and have access to a Dynatrace environment with
Workflows and Site Reliability Guardian turned on.
In this tutorial, you'll learn how to:
deployment finished SDLC event from your CI/CD pipeline to Dynatrace.A Dynatrace environment with
Workflows and Site Reliability Guardian turned on.
An access token with the openpipeline.events_sdlc scope.
The following Workflows permissions required if your pipeline triggers validations through the API or automates workflow execution.
automation:workflows:read: View workflows
automation:workflows:admin: Create and edit workflows
automation:workflows:run: Trigger a workflow via API
Automated release validation connects your CI/CD pipeline to Site Reliability Guardian through SDLC events.
When a deployment finishes, Dynatrace:
To send events, use one of the following methods:
POST request directly to the SDLC events ingestion endpoint.
For more information, see Ingest SDLC events for the endpoint URL, authentication details, and payload format.For the full event schema, see SDLC events semantic dictionary.
Your CI/CD pipeline must send a deployment finished SDLC event to Dynatrace when a deployment completes.
Dynatrace uses the event's timeframe to scope the Guardian validation.
Include the following key fields in the event payload:
| Field | Example value | Description |
|---|---|---|
|
| Identifies the event as a deployment |
|
| Marks the deployment as completed |
|
| Unique identifier for this deployment run |
|
| Name of the deployed service |
|
| Deployment environment ( |
|
| Outcome of the deployment |
Result: When your pipeline finishes a deployment, Dynatrace receives a deployment finished event and makes it available for the workflow trigger.
A lifecycle guardian defines the objectives your service must meet to pass validation. To get started quickly, use a predefined template such as Four golden signals, which covers latency, traffic, errors, and saturation.
Create a guardian from the Four golden signals template.
Add at least one tag, for example, service:payment-api or stage:staging, so you can filter validation results by tag in DQL queries (Step 4).
Alternatively, use the guardian ID, which you can copy from the browser address bar when viewing the guardian.
Define the variables that the workflow passes in Configure a workflow to trigger validation step. Variable names must match exactly what the workflow provides in the next step.
| Variable | Description |
|---|---|
| Name of the deployment |
| Identifier of the deployed service |
| Git commit revision of the deployed code |
| Version of the deployed artifact |
Result: Your guardian is saved and tagged. Copy the guardian ID from the browser address bar; you'll need it when you configure the workflow.
For more information, see Create a Site Reliability guardian for available templates and objective configuration options.
A workflow listens for the deployment finished SDLC event and automatically triggers your lifecycle guardian.
To configure a workflow:
Go to
Workflows.
Configure the trigger.
Set the trigger type to Event.
Copy and paste the following filter query in the event trigger's Filter query field to match deployment events for your service.
event.kind == "SDLC_EVENT" AND event.type == "deployment" AND event.status == "finished"
Optionally, you can filter by stage by adding AND cicd.deployment.release_stage == "staging" to your query.
Add a Site Reliability Guardian action.
Select the Guardian you created in the Create a lifecycle guardian step.
Set the Timeframe to Last 2 hours. Adjust the timeframe to match your typical deployment and stabilization window. A shorter time window reduces noise, while a longer one captures slower-emerging issues.
Define the guardian variables in your guardian configuration if you haven't done it yet. Names must match exactly.
Pass the guardian variables from the incoming event to store the release metadata in the Guardian result.
Map them in the workflow action:
| Guardian variable | Expression | Source field |
|---|---|---|
|
| Name of the deployment |
|
| Identifier of the deployed service |
|
| Git commit revision of the deployed code |
|
| Version of the deployed artifact |
Select Create draft.
Select Deploy.
Select Run.
Result: When a deployment finished event occurs, the workflow automatically triggers guardian validation.
After the guardian completes a validation, Dynatrace emits a validation finished SDLC event.
Use the following DQL query to retrieve results and drive pipeline decisions:
fetch events| filter event.kind == "SDLC_EVENT"| filter event.provider == "dynatrace.site.reliability.guardian"| filter event.type == "validation"| filter event.status == "finished"| filter contains(dt.srg.tags, "payment-api")| fields timestamp,validation.result,version = event.version,guardian_name = dt.srg.name,guardian_id = dt.srg.id,guardian_objective_results = dt.srg.validation.summary,executed_workflow = dt.automation_engine.workflow.id
To inspect individual objective results, filter for event.type == "validation.objective" instead.
Result: Based on the DQL query you retrieved results which you can use drive pipeline decisions.
For more information, see SRG event structure.
Extend the workflow with conditional actions based on the validation result. For more information, see workflow actions for the full list of available actions.
Result: You extended the workflow with conditional workflow actions such as notifications.
You've set up automated release validation with Site Reliability Guardian.
Your pipeline can now:
As next steps, consider:
Workflows