---
title: Definitions
summary: Definitions are used to configure alerts on how to observe a metric.
url: >-
  https://www.fastly.com/documentation/reference/api/observability/alerts/definition
---

Definitions are used to configure alerts on how to observe a metric.

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `created_at` | string | Time when the definition was created (RFC3339). (Read-only) |
| `description` | string | Additional text that is included in the alert notification. |
| `dimensions` | object | More filters depending on the source type. |
| `evaluation_strategy` | object | Criteria on how to alert. |
| `id` | string | A unique identifier for a definition. (Read-only) |
| `integration_ids` | array | List of integrations used to notify when alert fires. Refer to <a href="https://www.fastly.com/documentation/reference/api/observability/notifications/">Notification Service</a>. |
| `metric` | string | The metric name to alert on for a specific source: <a href="https://www.fastly.com/documentation/reference/api/metrics-stats/domain-inspector/historical">domains</a>, <a href="https://www.fastly.com/documentation/reference/api/metrics-stats/origin-inspector/historical">origins</a> or <a href="https://www.fastly.com/documentation/reference/api/metrics-stats/historical-stats">stats</a>. |
| `name` | string | The name of the alert definition. |
| `object` | string | The resource type. (Read-only) |
| `service_id` | string | The service on which the definition will alert on. |
| `source` | string | The source where the metric comes from. |
| `updated_at` | string | Time when the definition was last updated (RFC3339). (Read-only) |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `compute_resp_status_404_rate` | number | Fraction of Compute responses with 404 codes delivered. If there are no responses, this value will be 0. |
| `compute_resp_status_4xx_excl_404_rate` | number | Fraction of Compute responses with non-404 4xx codes delivered. If there are no responses, this value will be 0. |
| `compute_resp_status_4xx_rate` | number | Fraction of Compute responses with 4xx codes delivered from domain. If there are no responses, this value will be 0. |
| `compute_resp_status_5xx_rate` | number | Fraction of Compute responses with 5xx codes delivered from domain. If there are no responses, this value will be 0. |
| `compute_resp_status_gte_400_rate` | number | Fraction of Compute responses with 4xx or 5xx codes delivered from domain. If there are no responses, this value will be 0. |
| `compute_resp_status_lt_500_rate` | number | Fraction of Compute responses with non-5xx codes delivered from domain. If there are no responses, this value will be 0. |
| `origin_offload_bytes` | number | The number of bytes offloaded to the edge. |
| `status_404_rate` | number | Fraction of VCL responses with 404 codes delivered. If there are no responses, this value will be 0. |
| `status_4xx_excl_404_rate` | number | Fraction of VCL responses with non-404 4xx codes delivered. If there are no responses, this value will be 0. |
| `status_4xx_rate` | number | Fraction of VCL responses with 4xx codes delivered from domain. If there are no responses, this value will be 0. |
| `status_5xx_rate` | number | Fraction of VCL responses with 5xx codes delivered from domain. If there are no responses, this value will be 0. |
| `status_gte_400_rate` | number | Fraction of VCL responses with 4xx or 5xx codes delivered from domain. If there are no responses, this value will be 0. |
| `status_lt_500_rate` | number | Fraction of VCL responses with non-5xx codes delivered from domain. If there are no responses, this value will be 0. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `all_bandwidth` | integer | The amount of bandwidth from your origin. |
| `all_status_404_rate` | number | Fraction of all responses with 404 codes delivered (Compute, WAF, and VCL). If there are no responses, this value will be 0. |
| `all_status_4xx_excl_404_rate` | number | Fraction of all responses with non-404 4xx codes delivered (Compute, WAF, and VCL). If there are no responses, this value will be 0. |
| `all_status_4xx_rate` | number | Fraction of all responses with 4xx codes delivered (Compute, WAF, and VCL). If there are no responses, this value will be 0. |
| `all_status_5xx_rate` | number | Fraction of all responses with 5xx codes delivered (Compute, WAF, and VCL). If there are no responses, this value will be 0. |
| `all_status_gte_400_rate` | number | Fraction of all responses with 4xx or 5xx codes delivered (Compute, WAF, and VCL). If there are no responses, this value will be 0. |
| `all_status_lt_500_rate` | number | Fraction of all responses with non-5xx codes delivered (Compute, WAF, and VCL). If there are no responses, this value will be 0. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `ignore_below` | number | Threshold for the denominator value used in evaluations that calculate a rate or ratio. Usually used to filter out noise. |
| `period` | string | The length of time to evaluate whether the conditions have been met. The data is polled every minute. |
| `threshold` | number | Threshold used to alert. |
| `type` | string | Type of strategy to use to evaluate. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `all_status_4xx_rate` | number | Fraction of all responses with 4xx codes delivered (Compute and VCL). If there are no responses, this value will be 0. |
| `all_status_5xx_rate` | number | Fraction of all responses with 5xx codes delivered (Compute and VCL). If there are no responses, this value will be 0. |
| `all_status_gte_400_rate` | number | Fraction of all responses with 4xx or 5xx codes delivered (Compute and VCL). If there are no responses, this value will be 0. |
| `all_status_lt_500_rate` | number | Fraction of all responses with non-5xx codes delivered (Compute and VCL). If there are no responses, this value will be 0. |
| `status_404_rate` | number | Fraction of VCL responses with 404 codes delivered. If there are no responses, this value will be 0. |
| `status_4xx_excl_404_rate` | number | Fraction of VCL responses with non-404 4xx codes delivered. If there are no responses, this value will be 0. |
| `status_4xx_rate` | number | Fraction of VCL responses with 4xx codes delivered. If there are no responses, this value will be 0. |
| `status_5xx_rate` | number | Fraction of VCL responses with 5xx codes delivered. If there are no responses, this value will be 0. |
| `status_gte_400_rate` | number | Fraction of VCL responses with 4xx or 5xx codes delivered. If there are no responses, this value will be 0. |
| `status_lt_500_rate` | number | Fraction of VCL responses with non-5xx codes delivered. If there are no responses, this value will be 0. |

## API endpoints

### List definitions

**GET** `/alerts/definitions`

List all definitions for a particular customer. Definitions can be filtered by name, service_id, and integration_id.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `cursor` | string | query | No | Cursor value from the <code>next_cursor</code> field of a previous response, used to retrieve the next page. To request the first page, this should be empty. |
| `integration_id` | string | query | No | Filter definitions by integration. |
| `limit` | integer | query | No | Limit how many results are returned. |
| `name` | string | query | No | Filter definitions by name. |
| `service_id` | string | query | No | Filter results based on a service_id. |
| `sort` | string | query | No | Sort the items by field provided ascending or descending. |

### Create definition

**POST** `/alerts/definitions`

Create a definition for a particular customer based on metrics.

### Read definition

**GET** `/alerts/definitions/{definition_id}`

Retrieve an existing definition by using its ID.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `definition_id` | string | path | Yes | The ID of the definition that is requested. |

### Update definition

**PUT** `/alerts/definitions/{definition_id}`

Update a definition with a new configuration.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `definition_id` | string | path | Yes | The ID of the definition that is requested. |

### Delete definition

**DELETE** `/alerts/definitions/{definition_id}`

Delete a definition using its ID.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `definition_id` | string | path | Yes | The ID of the definition that is requested. |
