import { Command as $Command } from "@smithy/smithy-client"; import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; import type { GetMetricDataV2Request, GetMetricDataV2Response } from "../models/models_1"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link GetMetricDataV2Command}. */ export interface GetMetricDataV2CommandInput extends GetMetricDataV2Request { } /** * @public * * The output of {@link GetMetricDataV2Command}. */ export interface GetMetricDataV2CommandOutput extends GetMetricDataV2Response, __MetadataBearer { } declare const GetMetricDataV2Command_base: { new (input: GetMetricDataV2CommandInput): import("@smithy/smithy-client").CommandImpl; new (input: GetMetricDataV2CommandInput): import("@smithy/smithy-client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions; }; /** *

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 3 months, * at varying intervals. It does not support agent queues.

*

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

* *

When you make a successful API request, you can expect the following metric values in the response:

*
    *
  1. *

    * Metric value is null: The calculation cannot be performed due to divide by * zero or insufficient data

    *
  2. *
  3. *

    * Metric value is a number (including 0) of defined type: The number provided * is the calculation result

    *
  4. *
  5. *

    * MetricResult list is empty: The request cannot find any data in the * system

    *
  6. *
*

The following guidelines can help you work with the API:

*
    *
  • *

    Each dimension in the metric response must contain a value

    *
  • *
  • *

    Each item in MetricResult must include all requested metrics

    *
  • *
  • *

    If the response is slow due to large result sets, try these approaches:

    *
      *
    • *

      Narrow the time range of your request

      *
    • *
    • *

      Add filters to reduce the amount of data returned

      *
    • *
    *
  • *
*
* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { ConnectClient, GetMetricDataV2Command } from "@aws-sdk/client-connect"; // ES Modules import * // const { ConnectClient, GetMetricDataV2Command } = require("@aws-sdk/client-connect"); // CommonJS import * // import type { ConnectClientConfig } from "@aws-sdk/client-connect"; * const config = {}; // type is ConnectClientConfig * const client = new ConnectClient(config); * const input = { // GetMetricDataV2Request * ResourceArn: "STRING_VALUE", // required * StartTime: new Date("TIMESTAMP"), // required * EndTime: new Date("TIMESTAMP"), // required * Interval: { // IntervalDetails * TimeZone: "STRING_VALUE", * IntervalPeriod: "FIFTEEN_MIN" || "THIRTY_MIN" || "HOUR" || "DAY" || "WEEK" || "TOTAL", * }, * Filters: [ // FiltersV2List // required * { // FilterV2 * FilterKey: "STRING_VALUE", * FilterValues: [ // FilterValueList * "STRING_VALUE", * ], * StringCondition: { // FilterV2StringCondition * Comparison: "NOT_EXISTS", * }, * }, * ], * Groupings: [ // GroupingsV2 * "STRING_VALUE", * ], * Metrics: [ // MetricsV2 // required * { // MetricV2 * Name: "STRING_VALUE", * Threshold: [ // ThresholdCollections * { // ThresholdV2 * Comparison: "STRING_VALUE", * ThresholdValue: Number("double"), * }, * ], * MetricId: "STRING_VALUE", * MetricFilters: [ // MetricFiltersV2List * { // MetricFilterV2 * MetricFilterKey: "STRING_VALUE", * MetricFilterValues: [ // MetricFilterValueList * "STRING_VALUE", * ], * Negate: true || false, * }, * ], * }, * ], * NextToken: "STRING_VALUE", * MaxResults: Number("int"), * }; * const command = new GetMetricDataV2Command(input); * const response = await client.send(command); * // { // GetMetricDataV2Response * // NextToken: "STRING_VALUE", * // MetricResults: [ // MetricResultsV2 * // { // MetricResultV2 * // Dimensions: { // DimensionsV2Map * // "": "STRING_VALUE", * // }, * // MetricInterval: { // MetricInterval * // Interval: "FIFTEEN_MIN" || "THIRTY_MIN" || "HOUR" || "DAY" || "WEEK" || "TOTAL", * // StartTime: new Date("TIMESTAMP"), * // EndTime: new Date("TIMESTAMP"), * // }, * // Collections: [ // MetricDataCollectionsV2 * // { // MetricDataV2 * // Metric: { // MetricV2 * // Name: "STRING_VALUE", * // Threshold: [ // ThresholdCollections * // { // ThresholdV2 * // Comparison: "STRING_VALUE", * // ThresholdValue: Number("double"), * // }, * // ], * // MetricId: "STRING_VALUE", * // MetricFilters: [ // MetricFiltersV2List * // { // MetricFilterV2 * // MetricFilterKey: "STRING_VALUE", * // MetricFilterValues: [ // MetricFilterValueList * // "STRING_VALUE", * // ], * // Negate: true || false, * // }, * // ], * // }, * // Value: Number("double"), * // }, * // ], * // }, * // ], * // }; * * ``` * * @param GetMetricDataV2CommandInput - {@link GetMetricDataV2CommandInput} * @returns {@link GetMetricDataV2CommandOutput} * @see {@link GetMetricDataV2CommandInput} for command's `input` shape. * @see {@link GetMetricDataV2CommandOutput} for command's `response` shape. * @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape. * * @throws {@link InternalServiceException} (server fault) *

Request processing failed because of an error or failure with the service.

* * @throws {@link InvalidParameterException} (client fault) *

One or more of the specified parameters are not valid.

* * @throws {@link InvalidRequestException} (client fault) *

The request is not valid.

* * @throws {@link ResourceNotFoundException} (client fault) *

The specified resource was not found.

* * @throws {@link ThrottlingException} (client fault) *

The throttling limit has been exceeded.

* * @throws {@link ConnectServiceException} *

Base exception class for all service exceptions from Connect service.

* * * @public */ export declare class GetMetricDataV2Command extends GetMetricDataV2Command_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: GetMetricDataV2Request; output: GetMetricDataV2Response; }; sdk: { input: GetMetricDataV2CommandInput; output: GetMetricDataV2CommandOutput; }; }; }