---
title: Description template for alert conditions
source: https://docs.newrelic.com/docs/alerts/create-alert/condition-details/custom-alert-event-descriptions
---

For some types of conditions, you can define a description template that passes useful information downstream for better alert event responses or for use by other systems. You can create a description template in the UI or with GraphQL.

## Requirements [#requirements]

The description template feature is available for:

-   NRQL alert conditions
-   Infrastructure monitoring alert conditions

The description template field has a maximum character size of 4000.

## What is a description template? [#description]

For some [types of conditions](#requirements), you can create a description template that passes information about a condition and its alert events downstream. Using a description, you can:

-   Capture the reason for the condition
-   Define the signal being monitored
-   Define next steps
-   Add metadata to downstream systems

The **Description template** field allows you to use a general template structure that, when an alert event is generated, substitutes the generic sections with specific values. For example, let's say you used this in a description:

```handlebars
This is my condition name : {{conditionName}}
The hostname is : {{tags.fullHostname}}
```

An alert event resulting from this condition would fill in the details and you'd receive a notification like this:

```
This is my condition name : My Great Alert Condition
The hostname is : ip-123-45-67-89.us-west-1.compute.internal
```

## Create a description template [#create-description]

/\* 


  \*\*\[one.newrelic.com > All capabilities](https&#x3A;//one.newrelic.com/all-capabilities) > Alerts & AI > Alert conditions (Policies) > (select a policy) > (select a condition)\*\*: Click \*\*+ Add description template\*\* to open the field.
 \*/

You can create a description template using [the dedicated field for NRQL alerts](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/create-nrql-alert-conditions/), or the [Describe this condition section for infrastructure alerts](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/infrastructure-alert-conditions/infrastructure-alerts-add-edit-or-view-host-alert-information/).

## Description template template example [#example]

Here's a description template template example:

```handlebars
This is my condition name : {{conditionName}}
The hostname is : {{tags.fullHostname}}
Owning Team: {{tags.label.owning_team}}
Product: {{tags.label.product}}
ec2VpcId: {{tags.aws.ec2VpcId}}
Service name : {{tags.label.Name}}
AWS Region : {{tags.aws.awsRegion}}
AWS Availability Zone: {{tags.aws.awsAvailabilityZone}}
Department : {{tags.label.department}}
Environment: {{tags.label.environment}}
Cluster: {{tags.clusterName}}
Cluster Role: {{tags.clusterRole}}
EC2 Instance Type: {{tags.instanceType}}
EC2 InstanceID: {{tags.aws.ec2InstanceId}}
EC2 AmiId: {{tags.aws.ec2AmiId}}
EC2 Root Device Type: {{tags.aws.ec2RootDeviceType}}
```

## How to use attributes [#attributes-tags]

The attributes you can use in a description template are a subset of attributes attached to the [alert event](https://docs.newrelic.com/docs/alerts/create-alert/condition-details/alert-event-attributes). Here are some details about the available attributes and how to use them:

-   Alert event event attributes: For any of the [standard attributes available for use in a description template](https://docs.newrelic.com/docs/alerts/create-alert/condition-details/alert-event-attributes), use the format `{{AN_ATTRIBUTE}}`. For example:

    ```handlebars
    The target name is : {{targetName}}
    ```
-   Tag attributes: For tags, you would use the format `{{tags.TAG_NAME}}`. There are two types of tags:

    -   Entity-related tags: **For infrastructure conditions only.** You can find available [entity-related tags](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/tagging-use-tags-organize-group-what-you-monitor#) by going to the [entity explorer](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/ui-data/new-relic-one-entity-explorer-view-performance-across-apps-services-hosts) and looking under a service's **Metadata and tags**, or by viewing alert event details. Here's an example of using tags in a description template:

        ```handlebars
        The AWS region is : {{tags.aws.awsRegion}}
        Responsible team : {{tags.label.owning_team}}
        ```
    -   Facet clause tags: **For NRQL conditions only.** If a NRQL condition uses a `FACET` clause, you can use `tags` formatting to use those values in your description template. For example, if the NRQL query included `FACET hostName, cluster`, you could then use this:

        ```handlebars
        The host is : {{tags.hostName}}
        The cluster is : {{tags.cluster}}
        ```

Please note that tag names cannot include whitespace. The expanded values can include whitespace, but not the names of the tags themselves.

## Create a description template with GraphQL [#create-description-graphql]

You can create a description template on a NRQL alert condition through a GraphQL mutation with that description.

Here's an empty mutation template:

```graphql
mutation {
  alertsNrqlConditionStaticUpdate(
    accountId: YOUR_ACCOUNT_ID
    id: "YOUR_CONDITION_ID"
    condition: {description: ""}
  ) {
    YOUR_CUSTOM_INCIDENT_DESCRIPTION
  }
}
```

Here's an example mutation with a description template:

```graphql
mutation {
  alertsNrqlConditionStaticUpdate(
    accountId: 123456
    id: "123456"
    condition: {description: "timestamp : {{timestamp}} \n accountId : {{accountId}} \n type : {{type}} \n event : {{event}} \n description : {{description}} \n policyId : {{policyId}} \n policyName: {{policyName}} \n conditionName : {{conditionName}} \n conditionId : {{conditionId}} \n product : {{product}} \n conditionType : {{conditionType}} \n RunbookUrl : {{runbookUrl}} \n nrqlQuery : {{nrqlQuery}} \n nrqlEventType : {{nrqlEventType}} \n targetID : {{targetId}} \n targetName : {{targetName}} \n commandLine : {{tags.commandLine}} \n entityGuid : {{tags.entityGuid}} \n entityName : {{tags.entityName}} \n fullHostname : {{tags.fullHostname}} \n instanceType : {{tags.instanceType}} \n processDisplayName : {{tags.processDisplayName}}"}
  ) {
    description
  }
}
```

-   For more information on NRQL conditions and using the NerdGraph API, go to [NerdGraph API: NRQL condition alerts](https://docs.newrelic.com/docs/alerts/alerts-nerdgraph/nerdgraph-examples/nerdgraph-api-alerts-nrql-conditions).
-   For infrastructure monitoring conditions, you can create the description template when [creating an Infrastructure monitoring alert condition](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/infrastructure-alert-conditions/infrastructure-alerts-add-edit-or-view-host-alert-information).
-   To learn about how to structure a description template, see the [example template](#example) and the [attribute/tag instructions](#attributes-tags).

## Mentioning users or notifying channel in Slack [#mention-in-slack]

When creating a description that you know will be sent to [Slack](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-notifications/notification-channels-control-where-send-alerts#slack), you may wish to **@mention** a user or generate a channel-wide notification (for example, **@here** or **@channel**). To achieve this, simply include the User ID or a channel-wide notification in the description surrounded by `<` and `>` characters.

Here's an example for mentioning a user:

```
Attention <@LewCirne>
```

Here's an example for generating a channel-wide notification:

```
Attention <!channel>
```

> #### ⚠️ IMPORTANT
>
> Note that the Slack convention for channel-wide notifications in Incoming Webhooks is to use a `!` prefix instead of `@`. For example, `!here` or `!channel`.
