Validate releases with Dynatrace Site Reliability Guardian
Use Dynatrace SRG alongside Harness Continuous Verification to gate canary deployments based on reliability metrics
If your organization already uses Dynatrace Site Reliability Guardian (SRG) to evaluate release quality, you can integrate it into your Harness Continuous Delivery pipelines. Combine Dynatrace metric-driven validation with Harness deployment orchestration and the Continuous Verification (CV) AI Verify (v1) step for two independent layers of release verification.
Harness handles the deployment and the final promotion decision. Dynatrace performs the reliability evaluation. Together they form a release gate that catches regressions before they reach production traffic.
The integration uses standard Harness pipeline primitives (HTTP steps, shell scripts, and a reusable step group template) to call the Dynatrace SRG API. No custom plugins or feature flags are required.
What you will learn from this topic
How to meet the Before you begin requirements for Dynatrace SRG and Harness secrets
How the SRG Validation step group template runs warm-up wait, SRG trigger, and result polling
How to set up the pipeline so SRG and CV run in parallel and gate promotion
How to interpret verification outcomes when SRG and CV agree or disagree
Before you begin
Gather the following before you add the SRG Validation template to a pipeline:
Harness Continuous Delivery pipeline: A Deploy stage with any deployment strategy (canary, rolling, blue-green, and similar). Go to Continuous Delivery overview to review deployment concepts.
Dynatrace Site Reliability Guardian: A Dynatrace environment with Site Reliability Guardian configured, and a workflow that runs the SRG validation.
Dynatrace API token: A platform token with
automation:workflows:runandautomation:workflows:readscopes, stored in Harness Secret Manager (for example, asdyna-pf-token). Go to Harness Secret Manager to store the token.Dynatrace connection values: The Dynatrace Platform URL (for example,
https://abc123.apps.dynatrace.com) and the Workflow ID for your SRG guardian.
SRG Validation step group template
The SRG integration is packaged as a reusable step group template that you can reference from any pipeline. The template waits for the canary to warm up, triggers the Dynatrace SRG workflow, and polls for the result.
Template inputs
The template accepts a single input variable:
podName: The name of the canary pod deployed by Harness. This value is passed to Dynatrace so SRG evaluates metrics scoped to the canary instance only.
What each step does
The step group contains three steps that execute sequentially:
Wait (3 minutes): A bake period that gives the canary pod time to receive traffic and generate meaningful metrics before SRG evaluation begins.
Trigger SRG: An HTTP POST step that calls the Dynatrace Automation API to start the SRG workflow. It passes the canary pod name and a 10-minute evaluation window (
now-10mtonow) as input parameters. The step captures theexecutionIdfrom the response for use in the next step.Poll SRG Result: An HTTP GET step that polls the workflow execution endpoint until SRG finishes. It uses a retry strategy (up to 10 retries at 5-second intervals) to wait for the guardian to complete evaluation. After the guardian finishes, it captures four output variables:
VALIDATION_STATUS: The SRG verdict (passorfail).TASK_STATE: The execution state of the guardian task.GUARDIAN_NAME: The name of the guardian that ran the evaluation.POLL_RESPONSE: The full response body for debugging.
The following screenshot shows the SRG Validation step group template in the Harness Pipeline Studio:

Template YAML
Create this as an Account-level step group template so it can be reused across projects.
Set up the pipeline
The following pipeline demonstrates a complete canary deployment with both Dynatrace SRG and Harness Continuous Verification running in parallel. It uses the SRG Validation template from above and adds an AI Verify (v1) step alongside it.
Pipeline variables
Define these variables at the pipeline level:
dynaUrl: Your Dynatrace platform URL (for example,https://abc123.apps.dynatrace.com).workflowId: The ID of the Dynatrace Automation workflow that runs your SRG guardian.
Execution flow
The pipeline execution follows this sequence:
K8sCanaryDeploy: Deploys a single canary pod.
Parallel verification: The SRG Validation step group and the Continuous Verification AI Verify (v1) step run simultaneously. The step group template receives the canary pod name dynamically using the deployment info outcome expression.
Release Verification Summary: A shell script logs the verdicts from both SRG and Continuous Verification for visibility. This step runs regardless of the previous step outcomes (configured with
stageStatus: All).K8sCanaryDelete: Cleans up the canary pod.
K8sRollingDeploy: Promotes the deployment to all pods, but only if SRG returned
pass. This is controlled by a conditional execution expression on the step.
If any step fails, the pipeline triggers a stage rollback using K8sRollingRollback.
The following screenshot shows the full pipeline execution flow in the Harness Pipeline Studio, with the SRG Validation step group and the Continuous Verification AI Verify (v1) step running in parallel:

Pipeline YAML
Replace the service, environment, infrastructure, and connector references with your own.
Key expressions explained
A few expressions in this pipeline reference deployment outputs dynamically:
Canary pod name passed to SRG: The
podNamevariable uses a chained expression to get the last deployed pod from the canary step's output:This ensures SRG always evaluates metrics for the correct canary pod, even if the pod name changes between runs.
Promotion condition: The rolling deploy step uses a conditional execution to check the SRG verdict:
The deployment only promotes if the SRG validation returned
pass.
How it works
Once the pipeline is set up, the execution follows this flow:
Deploy: Harness deploys the new version using your chosen deployment strategy (canary, rolling, blue-green, and similar).
Run verification in parallel: Two verification paths execute simultaneously:
Dynatrace SRG validation: The step group triggers a Dynatrace SRG workflow, waits for it to complete, and captures the verdict.
Harness Continuous Verification AI Verify (v1) step: The standard AI Verify (v1) step evaluates health source metrics using Harness ML-based analysis.
Gate the release: A shell script inspects the SRG verdict. If SRG returns
passand the Continuous Verification step succeeds, Harness promotes the deployment. If either check fails, the pipeline stops and rolls back.
This parallel approach means SRG and Continuous Verification validate the deployment independently. A failure from either source blocks the release.
Successful execution
When both SRG and Continuous Verification pass, the pipeline promotes the deployment and all steps complete successfully:

Failed execution
When Continuous Verification detects anomalies or SRG returns a failing verdict, the pipeline stops the promotion. In this example, the AI Verify (v1) step failed while SRG passed: the downstream steps are skipped and the deployment is not promoted:

Verification outcomes
Running SRG and Continuous Verification in parallel produces three possible outcomes:
pass
Success
Deployment promoted to all pods
fail
Success
Deployment stopped: SRG blocked the release
pass
Failure
Deployment stopped: Continuous Verification detected anomalies
When both checks fail, the pipeline triggers a rollback automatically through the stage failure strategy.
Troubleshooting
Use the following entries when SRG and Continuous Verification disagree or a poll step fails:
Next steps
Configure the AI Verify (v1) step: Set up health sources for Harness Continuous Verification.
Dynatrace health source: Configure Dynatrace as a Continuous Verification health source alongside the SRG integration.
Create a Kubernetes canary deployment: Set up the canary strategy used in this topic.
Last updated
Was this helpful?