Script icon
Docker icon
If icon
SlackIncomingWebhook icon
Log icon
Return icon
Schedule icon

Dynatrace Synthetic Browser Step Failure Sentinel

Audits Dynatrace Synthetic browser monitors for failed transaction steps, evaluates user journey regressions, and alerts SRE teams via Slack.

Categories
CoreInfrastructure

Modern web applications rely on complex multi-step user journeys such as single sign-on authentication, shopping cart checkouts, and SaaS onboarding flows. Dynatrace Synthetic Browser Monitors execute scripted real-browser sessions across global vantage points to validate critical user paths. However, frontend releases often introduce subtle DOM selector changes, JavaScript runtime crashes, or third-party script timeouts that cause individual browser steps to fail. If synthetic monitoring failures are siloed within Dynatrace dashboards, engineering teams may take hours to notice broken customer conversion funnels. This sentinel inspects the Dynatrace Environment API v2 on a 15-minute interval, isolates step-level execution failures, and routes actionable incident notifications to on-call SRE teams on Slack with direct root-cause waterfall links.

How it works

  1. Scheduled triggering: Executes every 15 minutes via automated cron trigger (*/15 * * * *) or runs on-demand via manual execution.
  2. Monitor metadata inspection: Queries the Dynatrace Synthetic Monitors API to verify that the target monitor is active and retrieve its friendly name.
  3. Execution telemetry retrieval: Fetches recent browser session executions from /api/v2/synthetic/execution/{id} within the configured rolling time window.
  4. Step failure evaluation: Identifies failed test runs, parses failing step details and geographic location, and tallies the total failure count.
  5. Conditional alerting: An io.kestra.plugin.core.flow.If flowable determines whether failed executions meet or exceed max_failed_executions_threshold.
  6. Slack incident dispatch: Emits a priority notification to #sre-synthetic-alerts containing monitor identifiers and deep links to Dynatrace waterfall diagrams.
  7. Audit manifest export: Logs the execution summary and exports a structured JSON report for downstream observability pipelines.

Architecture diagram

flowchart TD
  A[fifteen_minute_dynatrace_audit Schedule Trigger] --> B[evaluate_dynatrace_browser_steps Python Script]
  B --> C[check_synthetic_failure Flowable If]
  C -- Executions Failed --> D[notify_slack_synthetic_failure Webhook]
  C -- Executions Nominal --> E[log_synthetic_status Log]
  D --> E
  E --> F[export_dynatrace_manifest Return]

What you get

  • Proactive notification of broken multi-step browser user journeys before real customers abandon carts.
  • Automated detection of DOM selector drift, slow API dependencies, and CDN asset delivery failures.
  • Contextual Slack alerts containing direct permalinks to Dynatrace root-cause analysis waterfall diagrams.
  • Structured audit manifests for tracking end-to-end user experience availability over time.

Who it's for

  • Site Reliability Engineers (SREs) managing end-user experience and customer journey SLAs.
  • Frontend Platform Engineers maintaining checkout, billing, and authentication funnels.
  • Quality Assurance Engineers running production synthetic test suites across multiple global regions.

Why orchestrate this with Kestra

Dynatrace captures deep synthetic browser execution traces, but incident escalation and cross-platform automation require orchestrating multiple tools. Kestra acts as the operational nerve center, polling the Dynatrace API, correlating test status with deployment events, and routing notifications into Slack channels with specific runbooks. With Kestra's containerized Python runner and native secret management, teams can securely query enterprise APM platforms without managing brittle cron infrastructure.

Use cases

  • Checkout Funnel Availability Guardrails: Verify that the e-commerce purchase sequence completes successfully without checkout button or payment iframe lockups.
  • Canary Deployment Verification: Run automated synthetic health checks immediately following a frontend production deployment to catch UI regressions early.
  • Global CDN Latency and Reachability Monitoring: Identify geographic regions where synthetic browser steps are failing due to DNS or edge caching degradation.

Inputs

Name Type Default Description
dynatrace_tenant_uri STRING https://abc12345.live.dynatrace.com Base URL of your Dynatrace SaaS environment or Managed cluster endpoint.
synthetic_monitor_id STRING SYNTHETIC_TEST-1234567890ABCDEF Dynatrace Synthetic Browser Monitor entity ID to audit for step failures.
max_failed_executions_threshold INT 1 Maximum allowable failed executions in the recent evaluation window before triggering an incident.
check_window_minutes INT 15 Rolling lookback duration in minutes for evaluating synthetic browser test executions.
alert_on_failure BOOL true Whether to dispatch automated Slack incident alerts when synthetic browser step failures are detected.

Expected outputs

  • {{ outputs.evaluate_dynatrace_browser_steps.vars.monitor_name }}: Human-readable display name of the evaluated synthetic monitor.
  • {{ outputs.evaluate_dynatrace_browser_steps.vars.failed_executions_count }}: Number of failed test executions recorded within the time window.
  • {{ outputs.evaluate_dynatrace_browser_steps.vars.has_failures }}: Boolean flag indicating whether the failure threshold was breached.
  • {{ outputs.export_dynatrace_manifest.value }}: Structured dictionary containing the consolidated synthetic evaluation manifest.

Prerequisites

  • Outbound HTTPS network access from Kestra execution workers to the Dynatrace tenant API endpoint.
  • A Dynatrace API token configured with the synthetic.read and synthetic.execute permission scopes.
  • A Slack Incoming Webhook URL configured in Kestra secrets.

Secrets

  • DYNATRACE_API_TOKEN: Dynatrace Environment API v2 token with permissions to read synthetic monitor configurations and executions.
  • SLACK_WEBHOOK_URL: Slack Incoming Webhook URL used to dispatch incident notifications.

Quick start

  1. Register DYNATRACE_API_TOKEN and SLACK_WEBHOOK_URL in your Kestra secret storage.
  2. Import this blueprint into your Kestra instance under the company.sre namespace.
  3. Update dynatrace_tenant_uri with your Dynatrace tenant domain and provide your target synthetic_monitor_id.
  4. Trigger a manual execution to test API authentication and verify the structured output.

Common pitfalls and troubleshooting

  • API Token Scopes: Ensure the token possesses the Read synthetic monitors, locations, and nodes (API v2) scope; missing scopes result in 403 Forbidden errors.
  • Monitor ID Format: Synthetic monitor IDs in Dynatrace follow the format SYNTHETIC_TEST-XXXXXXXXXXXXXXXX; verifying this ID in the Dynatrace URL prevents 404 errors.
  • Execution Lookback Window: If your synthetic monitor runs every 15 minutes, ensure check_window_minutes is set to at least 15 to capture at least one execution.

How to extend

  • Automated Frontend Rollback: Trigger an automated deployment rollback flow in GitHub Actions or Argo CD when critical synthetic journeys fail post-release.
  • PagerDuty High-Urgency Escalation: Route critical tier-1 synthetic monitor failures directly to on-call incident commanders via PagerDuty.
  • Multi-Monitor Loop: Wrap the monitor evaluation in an io.kestra.plugin.core.flow.ForEach task to monitor an entire suite of core synthetic tests.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.