|
| 1 | +--- |
| 2 | +title: "Dynamic dispatch with external data" |
| 3 | +description: "Automatically route alerts to the right responders using label mapping and dynamic dispatch, without frequently updating escalation rules" |
| 4 | +--- |
| 5 | + |
| 6 | +## Why dynamic dispatch |
| 7 | + |
| 8 | +In enterprise operations, you often manage thousands of monitored objects (hosts, services, databases, etc.), and the responsible responders change frequently as the organization evolves. Maintaining separate escalation rules for each object is both costly and error-prone. |
| 9 | + |
| 10 | +**Dynamic dispatch** solves this problem: you configure a single escalation rule as a "template", and the system automatically replaces the notification targets based on specific labels carried by the alert. This way, whenever responders change, you only need to update the label data — no need to modify the escalation rule itself. |
| 11 | + |
| 12 | +## How it works |
| 13 | + |
| 14 | +The core flow of dynamic dispatch consists of three steps: |
| 15 | + |
| 16 | +<Steps> |
| 17 | +<Step title="Alert enters the channel"> |
| 18 | +After being ingested through an integration, the alert enters a channel and matches a configured escalation rule. |
| 19 | +</Step> |
| 20 | + |
| 21 | +<Step title="System reads dynamic labels"> |
| 22 | +The system detects that the alert carries a specific label (e.g., `layer_person_reset_0_emails=bob@corp.com`) and automatically replaces the notification targets in level 1 of the escalation rule with Bob. |
| 23 | +</Step> |
| 24 | + |
| 25 | +<Step title="Dispatch based on the updated rule"> |
| 26 | +The system dispatches notifications according to the updated escalation rule. After dispatch completes, these control labels are automatically removed to keep the alert details page clean. |
| 27 | +</Step> |
| 28 | +</Steps> |
| 29 | + |
| 30 | +<Warning> |
| 31 | +Dynamic dispatch does not work independently — it depends on an existing escalation rule in the channel. You need to configure an escalation rule in advance as a "template". Dynamic labels only replace the notification targets (responders, teams, or chat bot) within the rule; other settings (notification methods, timeout, escalation levels, etc.) remain unchanged. |
| 32 | + |
| 33 | +For the full label parameter reference, see [Dynamic dispatch](/en/on-call/advanced/dynamic-notifications). |
| 34 | +</Warning> |
| 35 | + |
| 36 | +## How to generate dynamic labels |
| 37 | + |
| 38 | +The key to dynamic dispatch is ensuring alerts carry the correct labels. The following two approaches can achieve this — choose whichever fits your situation. |
| 39 | + |
| 40 | +### Approach 1: Add labels directly in the monitoring system |
| 41 | + |
| 42 | +If you have configuration access to your monitoring system and it supports custom labels (e.g., Prometheus, Nightingale, Zabbix), simply add the label to your alert rules: |
| 43 | + |
| 44 | +- **Label key**: `layer_person_reset_0_emails` |
| 45 | +- **Label value**: `bob@corp.com` |
| 46 | + |
| 47 | +<Tip> |
| 48 | +This approach requires minimal configuration and works well when responders rarely change. However, you'll need to update the alert rules in your monitoring system whenever personnel changes occur. |
| 49 | +</Tip> |
| 50 | + |
| 51 | +### Approach 2: Auto-generate via label mapping |
| 52 | + |
| 53 | +If you cannot modify the monitoring configuration, or prefer to centrally manage the "monitored object → responder" mapping (e.g., synced from a CMDB, configuration platform, or any external data source), use the **label mapping** feature. |
| 54 | + |
| 55 | +This approach creates a mapping table that automatically "translates" existing basic labels in alerts (such as `host`) into dynamic dispatch labels, without modifying the monitoring system. |
| 56 | + |
| 57 | +<Steps> |
| 58 | +<Step title="Prepare mapping data"> |
| 59 | +Compile the mapping between monitored objects and responders. For small datasets, you can enter data manually on the page; for large datasets, prepare a CSV file. |
| 60 | + |
| 61 | +<Note> |
| 62 | +The target column name in the CSV must use the dynamic dispatch parameter name (e.g., `layer_person_reset_0_emails`). |
| 63 | +</Note> |
| 64 | + |
| 65 | +| host (source label) | layer_person_reset_0_emails (target label) | |
| 66 | +| :--- | :--- | |
| 67 | +| web-server-01 | bob@corp.com | |
| 68 | +| db-server-02 | alice@corp.com | |
| 69 | + |
| 70 | +You can source this data from anywhere — CMDB, configuration management platforms, operations systems, or Excel spreadsheets — as long as it follows the format above. |
| 71 | +</Step> |
| 72 | + |
| 73 | +<Step title="Create a mapping table"> |
| 74 | +Import the data into the system to create a reusable mapping "dictionary". |
| 75 | + |
| 76 | +1. Go to **Integration Center → Label Mapping**. |
| 77 | +2. Click **Create Label Mapping**. |
| 78 | +3. Enter data: |
| 79 | + - **Upload file**: Upload a CSV file for bulk operations. |
| 80 | + - **Manual input**: Add entries one by one on the page for small-scale maintenance. |
| 81 | +4. After saving, you'll have a mapping table ready to be referenced by integrations. |
| 82 | + |
| 83 | +<Tip> |
| 84 | +To keep the mapping in sync with external systems in real time, use the [Flashduty API](https://developer.flashcat.cloud/flashduty/enrichment/mapping-data-upsert) to update the mapping table automatically, achieving fully unattended configuration sync. |
| 85 | +</Tip> |
| 86 | +</Step> |
| 87 | + |
| 88 | +<Step title="Configure label enhancement rules"> |
| 89 | +Reference the mapping table in your alert integration so the system automatically populates dynamic labels during alert ingestion. |
| 90 | + |
| 91 | +1. Go to **Integration Center → Label Enhancement**. |
| 92 | +2. Find your target alert integration (e.g., Zabbix integration) and open its details. |
| 93 | +3. Select the **Label Enhancement** tab, and set the action type to **Label Mapping**. |
| 94 | +4. **Select mapping table**: Choose the mapping table created in the previous step. |
| 95 | +5. **Configure mapping**: |
| 96 | + - **Source label**: Select `host`. |
| 97 | + - **Target label**: Select `layer_person_reset_0_emails`. |
| 98 | + |
| 99 | +Once configured, the system will automatically look up the `host` value in the mapping table during alert ingestion and generate the corresponding dynamic dispatch label. |
| 100 | +</Step> |
| 101 | + |
| 102 | +<Step title="Configure a template escalation rule"> |
| 103 | +Configure an escalation rule in the target channel. The notification targets in this rule can be set to any value (e.g., a default team) — it serves only as a "template". During actual dispatch, the notification targets will be replaced by the dynamic labels. |
| 104 | + |
| 105 | +Other settings in the rule (notification methods, timeout escalation, etc.) will function normally. |
| 106 | + |
| 107 | +For detailed configuration, see [Escalation rules](/en/on-call/channel/escalation-rule). |
| 108 | +</Step> |
| 109 | +</Steps> |
| 110 | + |
| 111 | +## Verify the result |
| 112 | + |
| 113 | +After completing the configuration, trigger a test alert to verify: |
| 114 | + |
| 115 | +1. **Check the dispatch process**: In **Incident Details → Timeline**, you'll see a log entry similar to: "Based on dynamic labels, responders have been reset to bob@corp.com". |
| 116 | +2. **Check alert labels**: On the alert details page, you will **not** see `layer_person_reset_xxx` labels — these control directives are automatically cleaned up after taking effect. |
| 117 | + |
| 118 | +## Further reading |
| 119 | + |
| 120 | +<CardGroup cols={2}> |
| 121 | + <Card title="Dynamic dispatch" icon="shuffle" href="/en/on-call/advanced/dynamic-notifications"> |
| 122 | + View the full dynamic label parameter reference and push examples |
| 123 | + </Card> |
| 124 | + <Card title="Label enhancement" icon="tags" href="/en/on-call/integration/alert-integration/label-enhancement"> |
| 125 | + Learn how to auto-generate new labels based on existing ones |
| 126 | + </Card> |
| 127 | +</CardGroup> |
0 commit comments