[ aws . connect ]

get-metric-data-v2

Description

Gets metric data from the specified Amazon Connect instance.

GetMetricDataV2 offers more features than GetMetricData , the previous version of this API. It has new metrics, offers filtering at a metric level, and offers the ability to filter and group data by channels, queues, routing profiles, agents, and agent hierarchy levels. It can retrieve historical data for the last 35 days, in 24-hour intervals.

For a description of the historical metrics that are supported by GetMetricDataV2 and GetMetricData , see Historical metrics definitions in the Amazon Connect Administrator’s Guide .

See also: AWS API Documentation

Synopsis

  get-metric-data-v2
--resource-arn <value>
--start-time <value>
--end-time <value>
--filters <value>
[--groupings <value>]
--metrics <value>
[--next-token <value>]
[--max-results <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]

Options

--resource-arn (string)

The Amazon Resource Name (ARN) of the resource. This includes the instanceId an Amazon Connect instance.

--start-time (timestamp)

The timestamp, in UNIX Epoch time format, at which to start the reporting interval for the retrieval of historical metrics data. The time must be before the end time timestamp. The time range between the start and end time must be less than 24 hours. The start time cannot be earlier than 35 days before the time of the request. Historical metrics are available for 35 days.

--end-time (timestamp)

The timestamp, in UNIX Epoch time format, at which to end the reporting interval for the retrieval of historical metrics data. The time must be later than the start time timestamp. It cannot be later than the current timestamp.

The time range between the start and end time must be less than 24 hours.

--filters (list)

The filters to apply to returned metrics. You can filter on the following resources:

  • Queues
  • Routing profiles
  • Agents
  • Channels
  • User hierarchy groups

At least one filter must be passed from queues, routing profiles, agents, or user hierarchy groups.

To filter by phone number, see Create a historical metrics report in the Amazon Connect Administrator’s Guide .

Note the following limits:

  • Filter keys : A maximum of 5 filter keys are supported in a single request. Valid filter keys: QUEUE | ROUTING_PROFILE | AGENT | CHANNEL | AGENT_HIERARCHY_LEVEL_ONE | AGENT_HIERARCHY_LEVEL_TWO | AGENT_HIERARCHY_LEVEL_THREE | AGENT_HIERARCHY_LEVEL_FOUR | AGENT_HIERARCHY_LEVEL_FIVE
  • Filter values : A maximum of 100 filter values are supported in a single request. VOICE, CHAT, and TASK are valid filterValue for the CHANNEL filter key. They do not count towards limitation of 100 filter values. For example, a GetMetricDataV2 request can filter by 50 queues, 35 agents, and 15 routing profiles for a total of 100 filter values, along with 3 channel filters.

(structure)

Contains the filter to apply when retrieving metrics with the GetMetricDataV2 API.

FilterKey -> (string)

The key to use for filtering data. For example, QUEUE , ROUTING_PROFILE, AGENT , CHANNEL , AGENT_HIERARCHY_LEVEL_ONE , AGENT_HIERARCHY_LEVEL_TWO , AGENT_HIERARCHY_LEVEL_THREE , AGENT_HIERARCHY_LEVEL_FOUR , AGENT_HIERARCHY_LEVEL_FIVE . There must be at least 1 key and a maximum 5 keys.

FilterValues -> (list)

The identifiers to use for filtering data. For example, if you have a filter key of QUEUE , you would add queue IDs or ARNs in FilterValues .

(string)

Shorthand Syntax:

FilterKey=string,FilterValues=string,string ...

JSON Syntax:

[
  {
    "FilterKey": "string",
    "FilterValues": ["string", ...]
  }
  ...
]

--groupings (list)

The grouping applied to the metrics that are returned. For example, when results are grouped by queue, the metrics returned are grouped by queue. The values that are returned apply to the metrics for each queue. They are not aggregated for all queues.

If no grouping is specified, a summary of all metrics is returned.

Valid grouping keys: QUEUE | ROUTING_PROFILE | AGENT | CHANNEL | AGENT_HIERARCHY_LEVEL_ONE | AGENT_HIERARCHY_LEVEL_TWO | AGENT_HIERARCHY_LEVEL_THREE | AGENT_HIERARCHY_LEVEL_FOUR | AGENT_HIERARCHY_LEVEL_FIVE

(string)

Syntax:

"string" "string" ...

--metrics (list)

The metrics to retrieve. Specify the name, groupings, and filters for each metric. The following historical metrics are available. For a description of each metric, see Historical metrics definitions in the Amazon Connect Administrator’s Guide .

AGENT_ADHERENT_TIME

This metric is available only in Amazon Web Services Regions where Forecasting, capacity planning, and scheduling is available.

Unit: Seconds

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

AGENT_NON_RESPONSE

Unit: Count

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

AGENT_OCCUPANCY

Unit: Percentage

Valid groupings and filters: Routing Profile, Agent, Agent Hierarchy

AGENT_SCHEDULE_ADHERENCE

This metric is available only in Amazon Web Services Regions where Forecasting, capacity planning, and scheduling is available.

Unit: Percent

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

AGENT_SCHEDULED_TIME

This metric is available only in Amazon Web Services Regions where Forecasting, capacity planning, and scheduling is available.

Unit: Seconds

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

AVG_ABANDON_TIME

Unit: Seconds

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

AVG_AFTER_CONTACT_WORK_TIME

Unit: Seconds

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

AVG_AGENT_CONNECTING_TIME

Unit: Seconds

Valid metric filter key: INITIATION_METHOD . For now, this metric only supports the following as INITIATION_METHOD : INBOUND | OUTBOUND | CALLBACK | API

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

AVG_HANDLE_TIME

Unit: Seconds

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

AVG_HOLD_TIME

Unit: Seconds

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

AVG_INTERACTION_AND_HOLD_TIME

Unit: Seconds

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

AVG_INTERACTION_TIME

Unit: Seconds

Valid groupings and filters: Queue, Channel, Routing Profile

AVG_QUEUE_ANSWER_TIME

Unit: Seconds

Valid groupings and filters: Queue, Channel, Routing Profile

CONTACTS_ABANDONED

Unit: Count

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

CONTACTS_CREATED

Unit: Count

Valid metric filter key: INITIATION_METHOD

Valid groupings and filters: Queue, Channel, Routing Profile

CONTACTS_HANDLED

Unit: Count

Valid metric filter key: INITIATION_METHOD , DISCONNECT_REASON

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

CONTACTS_HOLD_ABANDONS

Unit: Count

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

CONTACTS_QUEUED

Unit: Count

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

CONTACTS_TRANSFERRED_OUT

Unit: Count

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

CONTACTS_TRANSFERRED_OUT_BY_AGENT

Unit: Count

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

CONTACTS_TRANSFERRED_OUT_FROM_QUEUE

Unit: Count

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

MAX_QUEUED_TIME

Unit: Seconds

Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent Hierarchy

SERVICE_LEVEL

You can include up to 20 SERVICE_LEVEL metrics in a request.

Unit: Percent

Valid groupings and filters: Queue, Channel, Routing Profile

Threshold: For ThresholdValue , enter any whole number from 1 to 604800 (inclusive), in seconds. For Comparison , you must enter LT (for “Less than”).

SUM_CONTACTS_ANSWERED_IN_X

Unit: Count

Valid groupings and filters: Queue, Channel, Routing Profile

Threshold: For ThresholdValue , enter any whole number from 1 to 604800 (inclusive), in seconds. For Comparison , you must enter LT (for “Less than”).

SUM_CONTACTS_ABANDONED_IN_X

Unit: Count

Valid groupings and filters: Queue, Channel, Routing Profile

Threshold: For ThresholdValue , enter any whole number from 1 to 604800 (inclusive), in seconds. For Comparison , you must enter LT (for “Less than”).

SUM_CONTACTS_DISCONNECTED

Valid metric filter key: DISCONNECT_REASON

Unit: Count

Valid groupings and filters: Queue, Channel, Routing Profile

SUM_RETRY_CALLBACK_ATTEMPTS

Unit: Count

Valid groupings and filters: Queue, Channel, Routing Profile

(structure)

Contains information about the metric.

Name -> (string)

The name of the metric.

Warning

This parameter is required. The following Required = No is incorrect.

Threshold -> (list)

Contains information about the threshold for service level metrics.

(structure)

Contains information about the threshold for service level metrics.

Comparison -> (string)

The type of comparison. Only “less than” (LT) comparisons are supported.

ThresholdValue -> (double)

The threshold value to compare.

MetricFilters -> (list)

Contains the filters to be used when returning data.

(structure)

Contains information about the filter used when retrieving metrics. MetricFiltersV2 can be used on the following metrics: AVG_AGENT_CONNECTING_TIME , CONTACTS_CREATED , CONTACTS_HANDLED , SUM_CONTACTS_DISCONNECTED .

MetricFilterKey -> (string)

The key to use for filtering data.

Valid metric filter keys: INITIATION_METHOD , DISCONNECT_REASON . These are the same values as the InitiationMethod and DisconnectReason in the contact record. For more information, see ContactTraceRecord in the Amazon Connect Administrator’s Guide .

MetricFilterValues -> (list)

The values to use for filtering data.

Valid metric filter values for INITIATION_METHOD : INBOUND | OUTBOUND | TRANSFER | QUEUE_TRANSFER | CALLBACK | API

Valid metric filter values for DISCONNECT_REASON : CUSTOMER_DISCONNECT | AGENT_DISCONNECT | THIRD_PARTY_DISCONNECT | TELECOM_PROBLEM | BARGED | CONTACT_FLOW_DISCONNECT | OTHER | EXPIRED | API

(string)

JSON Syntax:

[
  {
    "Name": "string",
    "Threshold": [
      {
        "Comparison": "string",
        "ThresholdValue": double
      }
      ...
    ],
    "MetricFilters": [
      {
        "MetricFilterKey": "string",
        "MetricFilterValues": ["string", ...]
      }
      ...
    ]
  }
  ...
]

--next-token (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.

--max-results (integer)

The maximum number of results to return per page.

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.

Global Options

--debug (boolean)

Turn on debug logging.

--endpoint-url (string)

Override command’s default URL with the given URL.

--no-verify-ssl (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

--no-paginate (boolean)

Disable automatic pagination.

--output (string)

The formatting style for command output.

  • json
  • text
  • table
  • yaml
  • yaml-stream

--query (string)

A JMESPath query to use in filtering the response data.

--profile (string)

Use a specific profile from your credential file.

--region (string)

The region to use. Overrides config/env settings.

--version (string)

Display the version of this tool.

--color (string)

Turn on/off color output.

  • on
  • off
  • auto

--no-sign-request (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

--ca-bundle (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

--cli-read-timeout (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

--cli-connect-timeout (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

--cli-binary-format (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.

  • base64
  • raw-in-base64-out

--no-cli-pager (boolean)

Disable cli pager for output.

--cli-auto-prompt (boolean)

Automatically prompt for CLI input parameters.

--no-cli-auto-prompt (boolean)

Disable automatically prompt for CLI input parameters.

Output

NextToken -> (string)

If there are additional results, this is the token for the next set of results.

MetricResults -> (list)

Information about the metrics requested in the API request If no grouping is specified, a summary of metric data is returned.

(structure)

Contains information about the metric results.

Dimensions -> (map)

The dimension for the metrics.

key -> (string)

value -> (string)

Collections -> (list)

The set of metrics.

(structure)

Contains the name, thresholds, and metric filters.

Metric -> (structure)

The metric name, thresholds, and metric filters of the returned metric.

Name -> (string)

The name of the metric.

Warning

This parameter is required. The following Required = No is incorrect.

Threshold -> (list)

Contains information about the threshold for service level metrics.

(structure)

Contains information about the threshold for service level metrics.

Comparison -> (string)

The type of comparison. Only “less than” (LT) comparisons are supported.

ThresholdValue -> (double)

The threshold value to compare.

MetricFilters -> (list)

Contains the filters to be used when returning data.

(structure)

Contains information about the filter used when retrieving metrics. MetricFiltersV2 can be used on the following metrics: AVG_AGENT_CONNECTING_TIME , CONTACTS_CREATED , CONTACTS_HANDLED , SUM_CONTACTS_DISCONNECTED .

MetricFilterKey -> (string)

The key to use for filtering data.

Valid metric filter keys: INITIATION_METHOD , DISCONNECT_REASON . These are the same values as the InitiationMethod and DisconnectReason in the contact record. For more information, see ContactTraceRecord in the Amazon Connect Administrator’s Guide .

MetricFilterValues -> (list)

The values to use for filtering data.

Valid metric filter values for INITIATION_METHOD : INBOUND | OUTBOUND | TRANSFER | QUEUE_TRANSFER | CALLBACK | API

Valid metric filter values for DISCONNECT_REASON : CUSTOMER_DISCONNECT | AGENT_DISCONNECT | THIRD_PARTY_DISCONNECT | TELECOM_PROBLEM | BARGED | CONTACT_FLOW_DISCONNECT | OTHER | EXPIRED | API

(string)

Value -> (double)

The corresponding value of the metric returned in the response.