Skip to content

aws.lexv2_models.list_intent_metrics

Example SQL Queries

SELECT * FROM
aws.lexv2_models.list_intent_metrics
WHERE
"bot_id" = 'VALUE'
AND "start_date_time" = 'VALUE'
AND "end_date_time" = 'VALUE'
AND "metrics" = 'VALUE';

Description

Retrieves summary metrics for the intents in your bot. The following fields are required:

  • metrics – A list of AnalyticsIntentMetric objects. In each object, use the name field to specify the metric to calculate, the statistic field to specify whether to calculate the Sum, Average, or Max number, and the order field to specify whether to sort the results in Ascending or Descending order.

  • startDateTime and endDateTime – Define a time range for which you want to retrieve results.

Of the optional fields, you can organize the results in the following ways:

  • Use the filters field to filter the results, the groupBy field to specify categories by which to group the results, and the binBy field to specify time intervals by which to group the results.

  • Use the maxResults field to limit the number of results to return in a single response and the nextToken field to return the next batch of results if the response does not return the full set of results.

Note that an order field exists in both binBy and metrics. You can specify only one order in a given request.

Table Definition

Column NameColumn Data Type
bot_id Required Input Column

The identifier for the bot for which you retrieved intent metrics.

VARCHAR
end_date_time Required Input Column

The date and time that marks the end of the range of time for which you want to see intent metrics.

TIMESTAMP_S
metrics Required Input Column

A list of objects, each of which contains a metric you want to list, the statistic for the metric you want to return, and the order by which to organize the results.

STRUCT(
"name" VARCHAR,
"statistic" VARCHAR,
"order" VARCHAR
)[]
Show child fields
metrics[]
Show child fields
metrics[].name

The metric for which you want to get intent summary statistics.

  • Count – The number of times the intent was invoked.

  • Success – The number of times the intent succeeded.

  • Failure – The number of times the intent failed.

  • Switched – The number of times there was a switch to a different intent.

  • Dropped – The number of times the user dropped the intent.

metrics[].order

Specifies whether to sort the results in ascending or descending order.

metrics[].statistic

The summary statistic to calculate.

  • Sum – The total count for the category you provide in name.

  • Average – The total count divided by the number of intents in the category you provide in name.

  • Max – The highest count in the category you provide in name.

start_date_time Required Input Column

The timestamp that marks the beginning of the range of time for which you want to see intent metrics.

TIMESTAMP_S
bin_by Input Column

A list of objects, each of which contains specifications for organizing the results by time.

STRUCT(
"name" VARCHAR,
"interval" VARCHAR,
"order" VARCHAR
)[]
Show child fields
bin_by[]
Show child fields
bin_by[].interval

Specifies the interval of time by which to bin the analytics data.

bin_by[].name

Specifies the time metric by which to bin the analytics data.

bin_by[].order

Specifies whether to bin the analytics data in ascending or descending order. If this field is left blank, the default order is by the key of the bin in descending order.

filters Input Column

A list of objects, each of which describes a condition by which you want to filter the results.

STRUCT(
"name" VARCHAR,
"operator" VARCHAR,
"values" VARCHAR[]
)[]
Show child fields
filters[]
Show child fields
filters[].name

The category by which to filter the intents. The descriptions for each option are as follows:

  • BotAlias – The name of the bot alias.

  • BotVersion – The version of the bot.

  • LocaleId – The locale of the bot.

  • Modality – The modality of the session with the bot (audio, DTMF, or text).

  • Channel – The channel that the bot is integrated with.

  • SessionId – The identifier of the session with the bot.

  • OriginatingRequestId – The identifier of the first request in a session.

  • IntentName – The name of the intent.

  • IntentEndState – The final state of the intent.

filters[].operator

The operation by which to filter the category. The following operations are possible:

  • CO – Contains

  • EQ – Equals

  • GT – Greater than

  • LT – Less than

The operators that each filter supports are listed below:

  • BotAliasEQ.

  • BotVersionEQ.

  • LocaleIdEQ.

  • ModalityEQ.

  • ChannelEQ.

  • SessionIdEQ.

  • OriginatingRequestIdEQ.

  • IntentNameEQ, CO.

  • IntentEndStateEQ, CO.

filters[].values[]
group_by Input Column

A list of objects, each of which specifies how to group the results. You can group by the following criteria:

  • IntentName – The name of the intent.

  • IntentEndState – The final state of the intent. The possible end states are detailed in Key definitions in the user guide.

STRUCT(
"name" VARCHAR
)[]
Show child fields
group_by[]
Show child fields
group_by[].name

Specifies whether to group the intent stages by their name or their end state.

max_results Input Column

The maximum number of results to return in each page of results. If there are fewer results than the maximum page size, only the actual number of results are returned.

BIGINT
next_token Input Column

If the response from the ListIntentMetrics operation contains more results than specified in the maxResults parameter, a token is returned in the response.

Use the returned token in the nextToken parameter of a ListIntentMetrics request to return the next page of results. For a complete set of results, call the ListIntentMetrics operation until the nextToken returned in the response is null.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

results

The results for the intent metrics.

STRUCT(
"bin_keys" STRUCT(
"name" VARCHAR,
"value" BIGINT
)[],
"group_by_keys" STRUCT(
"name" VARCHAR,
"value" VARCHAR
)[],
"metrics_results" STRUCT(
"name" VARCHAR,
"statistic" VARCHAR,
"value" DOUBLE
)[]
)[]
Show child fields
results[]
Show child fields
results[].bin_keys[]
Show child fields
results[].bin_keys[].name

The criterion by which to bin the results.

results[].bin_keys[].value

The value of the criterion that defines the bin.

results[].group_by_keys[]
Show child fields
results[].group_by_keys[].name

A category by which the intent analytics were grouped.

results[].group_by_keys[].value

A member of the category by which the intent analytics were grouped.

results[].metrics_results[]
Show child fields
results[].metrics_results[].name

The metric that you requested. See Key definitions for more details about these metrics.

  • Count – The number of times the intent was invoked.

  • Success – The number of times the intent succeeded.

  • Failure – The number of times the intent failed.

  • Switched – The number of times there was a switch to a different intent.

  • Dropped – The number of times the user dropped the intent.

results[].metrics_results[].statistic

The statistic that you requested to calculate.

  • Sum – The total count for the category you provide in name.

  • Average – The total count divided by the number of intents in the category you provide in name.

  • Max – The highest count in the category you provide in name.

results[].metrics_results[].value

The value of the summary statistic for the metric that you requested.