Synthetic Monitoring Notifications

Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.

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.

Synthetic Monitoring notifications are not supported in your Continuous Testing CI/CD pipelines.

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.

Synthetic Monitoring monitor section, highlighting the pre-filled monitor messages

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:

PresetDescription
show_all(Default) Includes all enriched data and metadata.
hide_handlesHides @notification handles (for example, @slack-channel).
hide_allHides all additional content except for the custom message and event link.
Synthetic Monitoring monitor page, highlighting the content displayed in notification drop-down

Example

Channelshow_allhide_all
EmailFull test detail, screenshot, step infoOnly custom message and event link
SlackRich content + preview of failed runCustom message only

See Monitor Notifications for more information.

Simulate notifications

You can test your notification messages by sending simulated notifications. To do this:

  1. Add a notification handle to your monitor message
  2. Click the Simulate Notifications button:
Synthetics Monitor screen, highlighting the Simulate Notifications button
  1. Select the notification type you want to test and click Send:

    Send a notification simulating a test failure or recovery.

Simulated notifications include [TEST] in their subject lines and use a default monitor name when needed.

Examples:

Email notification simulating a test failure.
Email notification simulating a test recovery.

Important notes about simulated notifications:

  • The test results used in simulations are standardized sample data, not actual results from your specific test configuration.
  • Results vary based on test type, subtype (for API tests), and notification type:
    • Alert notifications: Simulated failure data
    • Recovery notifications: Simulated success data
  • All users receive the same simulated data regardless of their test setup.

Further Reading