RousselTMLEARNING

Observability

Workflows and AutomationEngine: automating notifications and remediation

Automate with Dynatrace Workflows (AutomationEngine): event-based, scheduled and on-demand triggers, DQL, JavaScript and HTTP tasks, Slack, Teams, Jira, ServiceNow and Ansible integrations, and automatic remediation.

1. Principle #

Trigger, tasks, conditions.

Structure #

Structure of a Dynatrace workflow
TriggerExample
EventA Davis problem opening, a security event, a custom event
ScheduleEvery Monday at 8 a.m.: cost report; every hour: check
On demandButton in an app or API call

Tasks are chained with conditions ({{ result("query").records | length > 0 }}), loops, retries and delays.

2. Example #

Notifying with context.

JavaScript task #

import { execution } from '@dynatrace-sdk/automation-utils';

export default async function ({ execution_id }) {
  const ex = await execution(execution_id);
  const problem = ex.event();                       // l'événement déclencheur
  const critical = problem['event.category'] === 'AVAILABILITY';
  return {
    channel: critical ? '#astreinte' : '#ops',
    text: `${problem['display_id']} : ${problem['event.name']} (${problem['affected_entity_ids']?.length ?? 0} entités)`,
  };
}

The next task (Slack or Teams) uses {{ result("decide").channel }} and {{ result("decide").text }}.

Good to know: The exact names of SDK functions and event fields depend on the version: start from the workflow templates offered in the app and adapt them.

3. Remediating safely #

Guardrails.

Rules #

  • Start with reversible actions: restart a pod, clear a cache, add a replica.
  • Add a human approval (wait task or button) for destructive actions.
  • Limit frequency: a workflow that restarts a service in a loop makes the incident worse.
  • Run workflows with a technical actor and minimal permissions.
Common mistake: A workflow runs with its actor's permissions: a workflow created by an administrator and editable by everyone is a privilege escalation.

Related articles

Accessing the Dynatrace playground and getting started

The Dynatrace playground is a demo environment full of real data: how to access it, what it allows and does n…

Grail buckets in Dynatrace: creation, routing, retention, rights and costs

Complete guide to Grail buckets: purpose, default buckets, creation in Storage management, with the API or Te…

The Dynatrace QuickStart app: getting your first data in minutes

Discover the QuickStart app: add data with Auto Discovery or a dedicated tile, read Findings, explore with da…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!