anomaly_detectors
Creates, updates, deletes, gets or lists an anomaly_detectors resource.
Overview
| Name | anomaly_detectors |
| Type | Resource |
| Id | aws.amp.anomaly_detectors |
Fields
The following fields are returned by SELECT queries:
- describe_anomaly_detector
- list_anomaly_detectors
| Name | Datatype | Description |
|---|---|---|
alias | string | The user-friendly name of the anomaly detector. (pattern: <code>[0-9A-Za-z][-.0-9A-Z_a-z]*</code>) |
anomaly_detector_id | string | The unique identifier of the anomaly detector. (pattern: <code>ad-[0-9A-Za-z][-.0-9A-Z_a-z]*</code>) |
arn | string | The Amazon Resource Name (ARN) of the anomaly detector. (pattern: <code>arn:aws[-a-z]*:aps:[-a-z0-9]+:[0-9]{12}:anomalydetector/ws-.+/ad-.+</code>) |
configuration | object | The configuration for the anomaly detection algorithm. |
created_at | string (date-time) | The timestamp when the anomaly detector was created. |
evaluation_interval_in_seconds | integer | The frequency, in seconds, at which the anomaly detector evaluates metrics. |
labels | object | The Amazon Managed Service for Prometheus metric labels associated with the anomaly detector. |
missing_data_action | object | Specifies the action to take when data is missing during anomaly detection evaluation. |
modified_at | string (date-time) | The timestamp when the anomaly detector was last modified. |
status | object | The current status of the anomaly detector. |
tags | object | The tags applied to the anomaly detector. |
| Name | Datatype | Description |
|---|---|---|
alias | string | The user-friendly name of the anomaly detector. (pattern: <code>[0-9A-Za-z][-.0-9A-Z_a-z]*</code>) |
anomaly_detector_id | string | The unique identifier of the anomaly detector. (pattern: <code>ad-[0-9A-Za-z][-.0-9A-Z_a-z]*</code>) |
arn | string | The Amazon Resource Name (ARN) of the anomaly detector. (pattern: <code>arn:aws[-a-z]*:aps:[-a-z0-9]+:[0-9]{12}:anomalydetector/ws-.+/ad-.+</code>) |
created_at | string (date-time) | The timestamp when the anomaly detector was created. |
modified_at | string (date-time) | The timestamp when the anomaly detector was last modified. |
status | object | The current status of the anomaly detector. |
tags | object | The tags applied to the anomaly detector. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_anomaly_detector | select | workspace_id, anomaly_detector_id, region | Retrieves detailed information about a specific anomaly detector, including its status and configuration. | |
list_anomaly_detectors | select | workspace_id, region | alias, maxResults, nextToken | Returns a paginated list of anomaly detectors for a workspace with optional filtering by alias. |
create_anomaly_detector | insert | workspace_id, region, alias, configuration | Creates an anomaly detector within a workspace using the Random Cut Forest algorithm for time-series analysis. The anomaly detector analyzes Amazon Managed Service for Prometheus metrics to identify unusual patterns and behaviors. | |
put_anomaly_detector | replace | workspace_id, anomaly_detector_id, region, configuration | When you call PutAnomalyDetector, the operation creates a new anomaly detector if one doesn't exist, or updates an existing one. Each call to this operation triggers a complete retraining of the detector, which includes querying the minimum required samples and backfilling the detector with historical data. This process occurs regardless of whether you're making a minor change like updating the evaluation interval or making more substantial modifications. The operation serves as the single method for creating, updating, and retraining anomaly detectors. | |
delete_anomaly_detector | delete | workspace_id, anomaly_detector_id, region | clientToken | Removes an anomaly detector from a workspace. This operation is idempotent. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
anomaly_detector_id | string | The identifier of the anomaly detector to delete. |
region | string | AWS region (default: us-east-1) |
workspace_id | string | The identifier of the workspace containing the anomaly detector to delete. |
alias | string | Filters the results to anomaly detectors with the specified alias. |
clientToken | string | A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. |
maxResults | integer | The maximum number of results to return in a single call. Valid range is 1 to 1000. |
nextToken | string | The pagination token to continue retrieving results. |
SELECT examples
- describe_anomaly_detector
- list_anomaly_detectors
Retrieves detailed information about a specific anomaly detector, including its status and configuration.
SELECT
alias,
anomaly_detector_id,
arn,
configuration,
created_at,
evaluation_interval_in_seconds,
labels,
missing_data_action,
modified_at,
status,
tags
FROM aws.amp.anomaly_detectors
WHERE workspace_id = '{{ workspace_id }}' -- required
AND anomaly_detector_id = '{{ anomaly_detector_id }}' -- required
AND region = '{{ region }}' -- required
;
Returns a paginated list of anomaly detectors for a workspace with optional filtering by alias.
SELECT
alias,
anomaly_detector_id,
arn,
created_at,
modified_at,
status,
tags
FROM aws.amp.anomaly_detectors
WHERE workspace_id = '{{ workspace_id }}' -- required
AND region = '{{ region }}' -- required
AND alias = '{{ alias }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_anomaly_detector
- Manifest
Creates an anomaly detector within a workspace using the Random Cut Forest algorithm for time-series analysis. The anomaly detector analyzes Amazon Managed Service for Prometheus metrics to identify unusual patterns and behaviors.
INSERT INTO aws.amp.anomaly_detectors (
alias,
evaluationIntervalInSeconds,
missingDataAction,
configuration,
labels,
clientToken,
tags,
workspace_id,
region
)
SELECT
'{{ alias }}' /* required */,
{{ evaluationIntervalInSeconds }},
'{{ missingDataAction }}',
'{{ configuration }}' /* required */,
'{{ labels }}',
'{{ clientToken }}',
'{{ tags }}',
'{{ workspace_id }}',
'{{ region }}'
RETURNING
anomaly_detector_id,
arn,
status,
tags
;
# Description fields are for documentation purposes
- name: anomaly_detectors
props:
- name: workspace_id
value: "{{ workspace_id }}"
description: Required parameter for the anomaly_detectors resource.
- name: region
value: "{{ region }}"
description: Required parameter for the anomaly_detectors resource.
- name: alias
value: "{{ alias }}"
- name: evaluationIntervalInSeconds
value: {{ evaluationIntervalInSeconds }}
- name: missingDataAction
description: |
Specifies the action to take when data is missing during anomaly detection evaluation.
value:
markAsAnomaly: {{ markAsAnomaly }}
skip: {{ skip }}
- name: configuration
description: |
The configuration for the anomaly detection algorithm.
value:
randomCutForest:
query: "{{ query }}"
shingleSize: {{ shingleSize }}
sampleSize: {{ sampleSize }}
ignoreNearExpectedFromAbove:
amount: {{ amount }}
ratio: {{ ratio }}
ignoreNearExpectedFromBelow:
amount: {{ amount }}
ratio: {{ ratio }}
- name: labels
value: "{{ labels }}"
- name: clientToken
value: "{{ clientToken }}"
description: |
An identifier used to ensure the idempotency of a write request.
- name: tags
value: "{{ tags }}"
description: |
A tag associated with a resource.
REPLACE examples
- put_anomaly_detector
When you call PutAnomalyDetector, the operation creates a new anomaly detector if one doesn't exist, or updates an existing one. Each call to this operation triggers a complete retraining of the detector, which includes querying the minimum required samples and backfilling the detector with historical data. This process occurs regardless of whether you're making a minor change like updating the evaluation interval or making more substantial modifications. The operation serves as the single method for creating, updating, and retraining anomaly detectors.
REPLACE aws.amp.anomaly_detectors
SET
evaluationIntervalInSeconds = {{ evaluationIntervalInSeconds }},
missingDataAction = '{{ missingDataAction }}',
configuration = '{{ configuration }}',
labels = '{{ labels }}',
clientToken = '{{ clientToken }}'
WHERE
workspace_id = '{{ workspace_id }}' --required
AND anomaly_detector_id = '{{ anomaly_detector_id }}' --required
AND region = '{{ region }}' --required
AND configuration = '{{ configuration }}' --required
RETURNING
anomaly_detector_id,
arn,
status,
tags;
DELETE examples
- delete_anomaly_detector
Removes an anomaly detector from a workspace. This operation is idempotent.
DELETE FROM aws.amp.anomaly_detectors
WHERE workspace_id = '{{ workspace_id }}' --required
AND anomaly_detector_id = '{{ anomaly_detector_id }}' --required
AND region = '{{ region }}' --required
AND clientToken = '{{ clientToken }}'
;