metrics
Creates, updates, deletes, gets or lists a metrics resource.
Overview
| Name | metrics |
| Type | Resource |
| Id | aws.connect.metrics |
Fields
The following fields are returned by SELECT queries:
- describe_metric
- list_metrics
- search_metrics
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the metric. May be qualified with $SAVED or $LATEST. |
category | string | The category of the metric. |
created_time | string (date-time) | The timestamp of when the metric was created. |
created_user | object | Information on the identity that created the file. |
creation_method | string | The method used to create the metric. Valid values: SERVICE_LEVEL_BUILDER (created with the guided service-level experience) | METRIC_BUILDER (created with the free-form metric builder). (SERVICE_LEVEL_BUILDER, METRIC_BUILDER) |
default_stat | string | The default stat aggregation for the metric. |
description | string | The description of the metric. |
effective_time | string (date-time) | The earliest time that can be queried for this metric. |
filters | array | The filters applied to the metric. |
groupings | array | The groupings available for this metric. |
id | string | The identifier of the metric. |
last_modified_region | string | The region where the metric was last modified. (pattern: <code>[a-z]{2}(-[a-z]+){1,2}(-[0-9])?</code>) |
last_modified_time | string (date-time) | The timestamp of when the metric was last modified. |
last_modified_user | object | Information on the identity that created the file. |
metric_calculation | object | Contains the formula and component metrics that define a custom metric calculation. |
name | string | The name of the metric. |
positive_trend_indicator | string | Specifies how to interpret a positive trend in metric data. Valid values: POSITIVE | NEGATIVE | NEUTRAL. (POSITIVE, NEGATIVE, NEUTRAL) |
primary_event_source | string | The primary event source for the metric data. |
primary_event_source_effective_timestamp_type | string | The timestamp type that determines where the metric appears on a time series. |
refresh_rate | integer (int64) | The minimum interval, in seconds, between data refreshes for this metric. |
status | string | The publish status of a metric. Valid values: PUBLISHED | SAVED. (PUBLISHED, SAVED) |
supported_stats | array | The stat aggregations available for this metric. |
supports_custom_calculation | boolean | Specifies whether the metric can be used as a component of custom metrics. |
supports_preaggregate_calculation | boolean | Specifies whether the metric can be used inside aggregating statistical functions (SUM, AVG, etc.) in custom metric calculations. |
tags | object | The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }. |
type | string | The type of the metric. Valid values: AWS_MANAGED | CUSTOMER_MANAGED. (AWS_MANAGED, CUSTOMER_MANAGED) |
unit | string | The display unit for metric data. Valid values: INTEGER | DOUBLE | PERCENT | SECONDS. (INTEGER, DOUBLE, PERCENT, SECONDS) |
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the metric. |
id | string | The identifier of the metric. |
last_modified_region | string | The region where the metric was last modified. (pattern: <code>[a-z]{2}(-[a-z]+){1,2}(-[0-9])?</code>) |
last_modified_time | string (date-time) | The timestamp of when the metric was last modified. |
name | string | The name of the metric. |
status | string | The publish status of a metric. Valid values: PUBLISHED | SAVED. (PUBLISHED, SAVED) |
type | string | The type of the metric. Valid values: AWS_MANAGED | CUSTOMER_MANAGED. (AWS_MANAGED, CUSTOMER_MANAGED) |
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the metric. May be qualified with $SAVED or $LATEST. |
category | string | The category of the metric. |
created_time | string (date-time) | The timestamp of when the metric was created. |
created_user | object | Information on the identity that created the file. |
creation_method | string | The method used to create the metric. Valid values: SERVICE_LEVEL_BUILDER (created with the guided service-level experience) | METRIC_BUILDER (created with the free-form metric builder). (SERVICE_LEVEL_BUILDER, METRIC_BUILDER) |
default_stat | string | The default stat aggregation for the metric. |
description | string | The description of the metric. |
effective_time | string (date-time) | The earliest time that can be queried for this metric. |
filters | array | The filters applied to the metric. |
groupings | array | The groupings available for this metric. |
id | string | The identifier of the metric. |
last_modified_region | string | The region where the metric was last modified. (pattern: <code>[a-z]{2}(-[a-z]+){1,2}(-[0-9])?</code>) |
last_modified_time | string (date-time) | The timestamp of when the metric was last modified. |
last_modified_user | object | Information on the identity that created the file. |
metric_calculation | object | Contains the formula and component metrics that define a custom metric calculation. |
name | string | The name of the metric. |
positive_trend_indicator | string | Specifies how to interpret a positive trend in metric data. Valid values: POSITIVE | NEGATIVE | NEUTRAL. (POSITIVE, NEGATIVE, NEUTRAL) |
primary_event_source | string | The primary event source for the metric data. |
primary_event_source_effective_timestamp_type | string | The timestamp type that determines where the metric appears on a time series. |
refresh_rate | integer (int64) | The minimum interval, in seconds, between data refreshes for this metric. |
status | string | The publish status of a metric. Valid values: PUBLISHED | SAVED. (PUBLISHED, SAVED) |
supported_stats | array | The stat aggregations available for this metric. |
supports_custom_calculation | boolean | Specifies whether the metric can be used as a component of custom metrics. |
supports_preaggregate_calculation | boolean | Specifies whether the metric can be used inside aggregating statistical functions (SUM, AVG, etc.) in custom metric calculations. |
tags | object | The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }. |
type | string | The type of the metric. Valid values: AWS_MANAGED | CUSTOMER_MANAGED. (AWS_MANAGED, CUSTOMER_MANAGED) |
unit | string | The display unit for metric data. Valid values: INTEGER | DOUBLE | PERCENT | SECONDS. (INTEGER, DOUBLE, PERCENT, SECONDS) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_metric | select | instance_id, metric_id, region | Retrieves the full definition of an existing metric from the specified Connect Customer instance. | |
list_metrics | select | instance_id, region | type, maxResults, nextToken | Retrieves a paginated list of metric summaries for the specified Connect Customer instance. Use pagination to ensure that the operation returns quickly and successfully. |
search_metrics | select | region | Searches for metrics in the specified Connect Customer instance using search criteria and optional tag-based filters. Use pagination to ensure that the operation returns quickly and successfully. | |
create_metric | insert | instance_id, region, MetricCalculation | Creates a new metric definition for the specified Connect Customer instance. You can create custom metrics that use formulas referencing existing Amazon Web Services-managed metrics, optionally with filters applied. | |
update_metric_content | update | instance_id, metric_id, region | Updates the calculation, unit, and/or trend indicator of an existing metric in the specified Connect Customer instance. | |
delete_metric | delete | instance_id, metric_id, region | Deletes an existing metric from the specified Connect Customer instance. This operation fails with ResourceConflictException if the metric is currently in use in a dashboard. | |
update_metric_metadata | exec | instance_id, metric_id, region | Updates the name and/or description of an existing metric in the specified Connect Customer instance. |
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 |
|---|---|---|
instance_id | string | The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance. |
metric_id | string | The identifier of the metric to update. Adding the $SAVED qualifier will update the saved version of the metric. Adding $LATEST or omitting a qualifier will update the published version. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of results to return per page. |
nextToken | string | The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. |
type | string | The type of metrics to list. Valid values: AWS_MANAGED | CUSTOMER_MANAGED. |
SELECT examples
- describe_metric
- list_metrics
- search_metrics
Retrieves the full definition of an existing metric from the specified Connect Customer instance.
SELECT
arn,
category,
created_time,
created_user,
creation_method,
default_stat,
description,
effective_time,
filters,
groupings,
id,
last_modified_region,
last_modified_time,
last_modified_user,
metric_calculation,
name,
positive_trend_indicator,
primary_event_source,
primary_event_source_effective_timestamp_type,
refresh_rate,
status,
supported_stats,
supports_custom_calculation,
supports_preaggregate_calculation,
tags,
type,
unit
FROM aws.connect.metrics
WHERE instance_id = '{{ instance_id }}' -- required
AND metric_id = '{{ metric_id }}' -- required
AND region = '{{ region }}' -- required
;
Retrieves a paginated list of metric summaries for the specified Connect Customer instance. Use pagination to ensure that the operation returns quickly and successfully.
SELECT
arn,
id,
last_modified_region,
last_modified_time,
name,
status,
type
FROM aws.connect.metrics
WHERE instance_id = '{{ instance_id }}' -- required
AND region = '{{ region }}' -- required
AND type = '{{ type }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
Searches for metrics in the specified Connect Customer instance using search criteria and optional tag-based filters. Use pagination to ensure that the operation returns quickly and successfully.
SELECT
arn,
category,
created_time,
created_user,
creation_method,
default_stat,
description,
effective_time,
filters,
groupings,
id,
last_modified_region,
last_modified_time,
last_modified_user,
metric_calculation,
name,
positive_trend_indicator,
primary_event_source,
primary_event_source_effective_timestamp_type,
refresh_rate,
status,
supported_stats,
supports_custom_calculation,
supports_preaggregate_calculation,
tags,
type,
unit
FROM aws.connect.metrics
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_metric
- Manifest
Creates a new metric definition for the specified Connect Customer instance. You can create custom metrics that use formulas referencing existing Amazon Web Services-managed metrics, optionally with filters applied.
INSERT INTO aws.connect.metrics (
Name,
MetricCalculation,
Unit,
Status,
ClientToken,
Description,
PositiveTrendIndicator,
Tags,
instance_id,
region
)
SELECT
'{{ Name }}',
'{{ MetricCalculation }}' /* required */,
'{{ Unit }}',
'{{ Status }}',
'{{ ClientToken }}',
'{{ Description }}',
'{{ PositiveTrendIndicator }}',
'{{ Tags }}',
'{{ instance_id }}',
'{{ region }}'
RETURNING
metric_arn,
metric_id
;
# Description fields are for documentation purposes
- name: metrics
props:
- name: instance_id
value: "{{ instance_id }}"
description: Required parameter for the metrics resource.
- name: region
value: "{{ region }}"
description: Required parameter for the metrics resource.
- name: Name
value: "{{ Name }}"
- name: MetricCalculation
description: |
Contains the formula and component metrics that define a custom metric calculation.
value:
CalculationComponents:
- Alias: "{{ Alias }}"
MetricName: "{{ MetricName }}"
MetricId: "{{ MetricId }}"
MetricFilters: "{{ MetricFilters }}"
Calculation: "{{ Calculation }}"
- name: Unit
value: "{{ Unit }}"
description: |
The display unit for metric data. Valid values: INTEGER | DOUBLE | PERCENT | SECONDS.
valid_values: ['INTEGER', 'DOUBLE', 'PERCENT', 'SECONDS']
- name: Status
value: "{{ Status }}"
description: |
The publish status of a metric. Valid values: PUBLISHED | SAVED.
valid_values: ['PUBLISHED', 'SAVED']
- name: ClientToken
value: "{{ ClientToken }}"
- name: Description
value: "{{ Description }}"
- name: PositiveTrendIndicator
value: "{{ PositiveTrendIndicator }}"
description: |
Specifies how to interpret a positive trend in metric data. Valid values: POSITIVE | NEGATIVE | NEUTRAL.
valid_values: ['POSITIVE', 'NEGATIVE', 'NEUTRAL']
- name: Tags
value: "{{ Tags }}"
UPDATE examples
- update_metric_content
Updates the calculation, unit, and/or trend indicator of an existing metric in the specified Connect Customer instance.
UPDATE aws.connect.metrics
SET
MetricCalculation = '{{ MetricCalculation }}',
Unit = '{{ Unit }}',
PositiveTrendIndicator = '{{ PositiveTrendIndicator }}'
WHERE
instance_id = '{{ instance_id }}' --required
AND metric_id = '{{ metric_id }}' --required
AND region = '{{ region }}' --required;
DELETE examples
- delete_metric
Deletes an existing metric from the specified Connect Customer instance. This operation fails with ResourceConflictException if the metric is currently in use in a dashboard.
DELETE FROM aws.connect.metrics
WHERE instance_id = '{{ instance_id }}' --required
AND metric_id = '{{ metric_id }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- update_metric_metadata
Updates the name and/or description of an existing metric in the specified Connect Customer instance.
EXEC aws.connect.metrics.update_metric_metadata
@instance_id='{{ instance_id }}' --required,
@metric_id='{{ metric_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"Name": "{{ Name }}",
"Description": "{{ Description }}"
}'
;