Synthetic Monitoring Notifications
このページは日本語には対応しておりません。随時翻訳に取り組んでいます。
翻訳に関してご質問やご意見ございましたら、
お気軽にご連絡ください。
Overview
Customize your alerts in Synthetic Monitoring to give on-call responders meaningful context. Synthetic Monitoring’s message templating system lets you enrich alerts with test details, extract data from test results, and route notifications conditionally based on the failure.
You can customize notifications using:
Pre-filled monitor messages
Synthetic Monitoring provides pre-filled messages with metadata such as:
- Test name
- Monitor ID
- Failing locations
- Last failed test run information
- Time the test started failing
These values appear by default in most notification channels. You can override or extend the message using templating.
Examples:
Request:
{{#with synthetics.attributes.result.request}}
We made a {{method}} request to `{{{url}}}`{{#if headers}} with the following headers:
{{#each headers}}
{{@key}}={{this}}
{{/each}}
{{/if}}
{{#if body}}And the body:
{{{body}}}
{{/if}}
{{/with}}
Response:
{{#with synthetics.attributes.result.response}}
We received an HTTP {{httpVersion}} response with a {{statusCode}} status code{{#if headers}} with the following headers:
{{#each headers}}
{{@key}}={{this}}
{{/each}}
{{/if}}
{{#if redirects}}
Redirections:
{{#each redirects}}
* {{statusCode}} redirect to `{{{location}}}`
{{/each}}
{{/if}}
The body's size was {{eval "humanize_bytes(bodySize)"}}{{#if body}} and contained:
{{{body}}}
{{/if}}
{{/with}}
{{! Websocket request and response details }}
{{#with synthetics.attributes.result}}
{{#if handshake }}
The handshake received a response with the {{handshake.response.statusCode}} status code.
{{/if}}
{{#if request}}
A WebSocket request was made with the message:
{{{request.message}}}
{{/if}}
{{#if response}}
and the response closed with status code {{response.close.statusCode}} and reason `{{response.close.reason}}`
{{#if response.message}}, containing the message:
{{{response.message}}}
{{else}}.{{/if}}
{{/if}}
{{/with}}
Iterate over extracted variables for API tests:
Config variables:
{{#each synthetics.attributes.result.variables.config}}
* **Name:** {{name}}
Type: {{type}}
Value: {{#if secure}}*Obfuscated (value hidden)*{{else}}{{value}}{{/if}}
{{/each}}
Extracted Variables (Only visible for recovery notifications):
{{#each synthetics.attributes.result.variables.extracted}}
* **Name:** {{name}}
Global Variable ID: {{id}}
Value: {{#if secure}}*Obfuscated (value hidden)*{{else}}{{val}}{{/if}}
{{/each}}
Iterate over steps extracting variables for multistep API tests:
{{! List extracted variables across all successful steps }}
# Extracted Variables
{{#each synthetics.attributes.result.steps}}
{{#each variables.extracted}}
* **Name**: `{{name}}`
Value: {{#if secure}}*Obfuscated (value hidden)*{{else}}`{{{val}}}`{{/if}}
{{/each}}
{{/each}}
Iterate over steps extracting variables for browser and mobile tests:
{{#each synthetics.attributes.result.steps}}
{{#if extractedValue}}
* **Name**: {{extractedValue.name}}
**Value:** {{#if extractedValue.secure}}*Obfuscated (value hidden)*{{else}}{{extractedValue.value}}{{/if}}
{{/if}}
{{/each}}
Display custom notifications message
Synthetic Monitoring notifications support the ability to display only the custom notification message in alert notifications, hiding all default enriched content such as query details, tags, screenshots, and footers.
By default, all monitors include enriched details in the alert message. This may include:
- Test metadata
- Failing step information
- Screenshots
- Tags
- Links to Datadog resources
Notification presets
You can select from the following options to hide or display the information relevant to you:
Preset | Description |
---|
show_all | (Default) Includes all enriched data and metadata. |
hide_handles | Hides @notification handles (for example, @slack-channel ). |
hide_all | Hides all additional content except for the custom message and event link. |
Example
Channel | show_all | hide_all |
---|
Email | Full test detail, screenshot, step info | Only custom message and event link |
Slack | Rich content + preview of failed run | Custom message only |
See Monitor Notifications for more information.
Further Reading