

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Lex V2의 운영 지표 모니터링
<a name="monitoring-operational-metrics"></a>

Amazon CloudWatch 및 AWS CloudTrail 는 봇과의 사용자 상호 작용을 모니터링하는 데 도움이 되도록 Amazon Lex V2와 통합되는 두 가지 AWS 서비스입니다. 이러한 서비스를 사용하여 작업을 기록하고, 거의 실시간으로 데이터를 전송하고, 기준 충족 시 알림 및 자동 작업을 설정할 수 있습니다.

**Topics**
+ [Amazon CloudWatch로 운영 지표 측정](monitoring-cloudwatch.md)
+ [Lex V2 AWS CloudTrail 용를 사용하여 이벤트 보기](logging-using-cloudtrail.md)

# Amazon CloudWatch로 운영 지표 측정
<a name="monitoring-cloudwatch"></a>

원시 데이터를 수집하여 읽기 가능하며 실시간에 가까운 지표로 처리하는 CloudWatch를 사용하여 Amazon Lex V2를 모니터링할 수 있습니다. 이러한 통계는 15개월간 보관되므로 기록 정보에 액세스하고 웹 애플리케이션 또는 서비스가 어떻게 실행되고 있는지 전체적으로 더 잘 파악할 수 있습니다. 특정 임곗값을 주시하다가 해당 임곗값이 충족될 때 알림을 전송하거나 조치를 취하도록 경보를 설정할 수도 있습니다. 자세한 내용은 [Amazon CloudWatch 사용 설명서](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/)를 참조하세요.

Amazon Lex V2 서비스는 `AWS/Lex` 네임스페이스에서 다음 지표를 보고합니다.


| 지표 | 설명 | 
| --- | --- | 
|  `AssistedSlotResolutionModelAccessDeniedErrorCount`  |  Amazon Lex V2가 Amazon Bedrock에 대한 액세스가 거부된 횟수 `RecognizeUtterance` 및 `StartConversation` 작업에 대한 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) `RecognizeText`의 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `AssistedSlotResolutionModelInvocationCount`  |  Amazon Bedrock이 간접적으로 호출된 횟수입니다. `RecognizeUtterance` 및 `StartConversation` 작업에 대한 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) `RecognizeText`의 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `AssistedSlotResolutionModelSystemErrorCount`  |  Amazon Bedrock에 전화할 때 5xx가 발생한 횟수입니다. `RecognizeUtterance` 및 `StartConversation` 작업에 대한 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) `RecognizeText`의 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `AssistedSlotResolutionModelThrottlingErrorCount`  |  Amazon Lex가 Amazon Bedrock에 의해 제한된 횟수입니다. `RecognizeUtterance` 및 `StartConversation` 작업에 대한 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) `RecognizeText`의 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `AssistedSlotResolutionResolvedSlotCount`  |  Amazon Bedrock이 슬롯 값을 반환한 횟수입니다. `RecognizeUtterance` 및 `StartConversation` 작업에 대한 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) `RecognizeText`의 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `KendraIndexAccessError`  |  Amazon Lex V2가 Amazon Kendra 인덱스에 액세스할 수 없는 횟수입니다. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `KendraLatency`  |  Amazon Kendra가 `AMAZON.KendraSearchIntent`의 요청에 응답하는 데 걸리는 시간입니다. 유효한 차원:  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 밀리초  | 
|  `KendraSuccess`  |  Amazon Lex V2가 Amazon Kendra 인덱스에 액세스할 수 없는 횟수입니다. 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `KendraSystemErrors`  |  Amazon Lex V2가 Amazon Kendra 인덱스에 액세스할 수 없는 횟수입니다. 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `KendraThrottledEvents`  |  Amazon Kendra 가 `AMAZON.KendraSearchIntent`의 요청을 제한한 횟수입니다. 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `RuntimeConcurrency`  |  지정된 기간 동안 동시 연결 수. `RuntimeConcurrency`은 `StatisticSet`로 보고됩니다. `RecognizeUtterance` 또는 `StartConversation` 작업에 대한 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 작업에 대한 유효 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `RuntimeInvalidLambdaResponses`  |  지정된 기간 동안 유효하지 않은 AWS Lambda 응답 수입니다. 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `RuntimeLambdaErrors`  |  지정된 기간에 발생한 Lambda 런타임 오류 수입니다. 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `RuntimePollyErrors`  |  지정된 기간 동안 유효하지 않은 Amazon Polly 응답 수입니다. 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `RuntimeRequestCount`  |  지정된 기간의 실행 시간 요청 수입니다. `RecognizeUtterance` 및 `StartConversation` 작업에 대한 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 작업에 대한 유효 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
| `RuntimeRequestLength` | Amazon Lex V2 봇과의 총 대화 시간입니다. [StartConversation](https://docs.aws.amazon.com/lexv2/latest/APIReference/API_runtime_StartConversation.html) 작업에만 적용할 수 있습니다. 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 밀리초 | 
|  `RuntimeSucessfulRequestLatency`  이 지표는 `RuntimeSucessfulRequestLatency`이며, `RuntimeSuccessfulRequestLatency`가 아닙니다.   |  요청 시간과 응답이 다시 전달된 시간 사이의 성공한 요청에 대한 지연 시간입니다. `RecognizeUtterance` 및 `StartConversation` 작업에 대한 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 작업에 대한 유효 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 밀리초  | 
|  `RuntimeSystemErrors`  |  지정된 기간에 발생한 시스템 오류 수입니다. 시스템 오류의 응답 코드 범위는 500\$1599입니다. `RecognizeUtterance` 및 `StartConversation` 작업에 대한 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 작업에 대한 유효 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `RuntimeThrottledEvents`  |  제한된 이벤트 수. Amazon Lex V2는 계정에 대해 설정된 초당 트랜잭션 한도 이상의 요청이 수신되면 이벤트를 제한합니다. 계정에 대해 설정된 한도가 자주 초과되면 한도 증가를 요청할 수 있습니다. 증가를 요청하려면 [AWS 서비스 한도](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html)를 참조하세요. `RecognizeUtterance` 및 `StartConversation` 작업에 대한 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 작업에 대한 유효 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 
|  `RuntimeUserErrors`  |  지정된 기간에 발생한 사용자 오류 수입니다. 사용자 오류의 응답 코드 범위는 400\$1499입니다. `RecognizeUtterance` 및 `StartConversation` 작업에 대한 유효한 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 작업에 대한 유효 차원: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/lexv2/latest/dg/monitoring-cloudwatch.html) 단위: 수  | 

Amazon Lex V2 지표에 다음 차원을 지원합니다.


|  차원  |  설명  | 
| --- | --- | 
|  Operation  |  항목을 생성한 Amazon Lex V2 작업의 이름(`RecognizeText`, `RecognizeUtterance`, `StartConversation`, `GetSession`, `PutSession`, `DeleteSession`).  | 
|  BotId  |  봇의 영숫자 고유 식별자입니다.  | 
|  BotAliasId  |  봇 별칭의 영숫자 고유 식별자입니다.  | 
|  BotVersion  |  봇의 숫자 버전입니다.  | 
|  InputMode  |  봇에 대한 입력 유형 - 음성, 텍스트 또는 DTMF.  | 
|  LocaleId  |  봇 로캘의 식별자(예: en-US 또는 FR-CA).  | 
|  Model  |  Amazon Bedrock 대형 언어 모델의 모델 ID를 나타냅니다.  | 
|  ModelType  |  Amazon Bedrock에서 간접적으로 호출되는 대규모 언어 모델 유형을 나타냅니다.  | 

# Lex V2 AWS CloudTrail 용를 사용하여 이벤트 보기
<a name="logging-using-cloudtrail"></a>

Amazon Lex V2는 Amazon Lex V2에서 사용자 AWS CloudTrail, 역할 또는 AWS 서비스가 수행한 작업에 대한 레코드를 제공하는 서비스와 통합됩니다. CloudTrail은 Amazon Lex V2에 대한 API 직접 호출을 이벤트로 캡처합니다. 캡처되는 직접 호출에는 Amazon Lex V2 콘솔로부터의 직접 호출과 Amazon Lex V2 API 작업에 대한 코드 직접 호출이 포함됩니다. 추적을 생성하면 Amazon Lex V2 이벤트를 포함한 CloudTrail 이벤트를 지속적으로 Amazon S3 버킷에 배포할 수 있습니다. 추적을 구성하지 않은 경우에도 **이벤트 기록**에서 CloudTrail 콘솔의 최신 이벤트를 볼 수 있습니다. CloudTrail에서 수집한 정보를 사용하여 Amazon Lex V2에 수행된 요청, 요청이 수행된 IP 주소, 요청을 수행한 사람, 요청이 수행된 시간 및 추가 세부 정보를 확인할 수 있습니다.

CloudTrail에 대한 자세한 내용은 [AWS CloudTrail 사용 설명서](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html)를 참조하세요.

## CloudTrail의 Amazon Lex V2 정보
<a name="lex-info-in-cloudtrail"></a>

CloudTrail은 계정 생성 시 AWS 계정에서 활성화됩니다. Amazon Lex V2에서 활동이 발생하면 해당 활동이 **이벤트 기록**의 다른 AWS 서비스 이벤트와 함께 CloudTrail 이벤트에 기록됩니다. AWS 계정에서 최신 이벤트를 확인, 검색 및 다운로드할 수 있습니다. 자세한 내용은 [CloudTrail 이벤트 기록을 사용하여 이벤트 보기](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)를 참조하세요.

Amazon Lex V2에 대한 이벤트를 포함하여 AWS 계정에 이벤트를 지속적으로 기록하려면 추적을 생성합니다. CloudTrail은 *추적*을 사용하여 Amazon S3 버킷으로 로그 파일을 전송할 수 있습니다. 콘솔에서 추적을 생성하면 기본적으로 모든 리전에 추적이 적용됩니다. 추적은 AWS 파티션에 있는 모든 리전의 이벤트를 로그하고 지정한 Amazon S3 버킷으로 로그 파일을 전송합니다. 또는 CloudTrail 로그에서 수집된 이벤트 데이터를 추가 분석 및 처리하도록 다른 AWS 서비스를 구성할 수 있습니다. 자세한 내용은 다음 자료를 참조하세요.
+ [추적 생성 개요](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html)
+ [CloudTrail 지원 서비스 및 통합](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-aws-service-specific-topics.html)
+ [CloudTrail에 대한 Amazon SNS 알림 구성](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/configure-sns-notifications-for-cloudtrail.html)
+ [여러 리전에서 CloudTrail 로그 파일 받기](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html) 및 [여러 계정에서 CloudTrail 로그 파일 받기](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html)

Amazon Lex V2는 [Model Building API V2](https://docs.aws.amazon.com/lexv2/latest/APIReference/API_Operations_Amazon_Lex_Model_Building_V2.html)에 나열된 모든 작업에 대한 로깅을 지원합니다.

모든 이벤트 또는 로그 항목에는 요청을 생성했던 사용자에 관한 정보가 포함됩니다. ID 정보를 이용하면 다음을 쉽게 판단할 수 있습니다.
+ 요청이 루트 또는 AWS Identity and Access Management IAM 사용자 자격 증명으로 이루어졌는지 여부입니다.
+ 역할 또는 페더레이션 사용자의 임시 자격 증명을 사용하여 요청이 생성되었는지 여부.
+ 다른 AWS 서비스에서 요청했는지 여부.

자세한 내용은 [CloudTrail userIdentity 요소](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html)를 참조하세요.

## Amazon Lex V2 로그 파일 항목 이해
<a name="understanding-service-name-entries"></a>

트레일이란 지정한 S3 버킷에 이벤트를 로그 파일로 입력할 수 있게 하는 구성입니다. CloudTrail 로그 파일에는 하나 이상의 로그 항목이 포함될 수 있습니다. 이벤트는 모든 소스로부터의 단일 요청을 나타내며 요청 작업, 작업 날짜와 시간, 요청 파라미터 등에 대한 정보가 들어 있습니다. CloudTrail 로그 파일은 퍼블릭 API 직접 호출의 주문 스택 트레이스가 아니므로 특정 순서로 표시되지 않습니다.

다음 예는 [CreateBotAlias](https://docs.aws.amazon.com/lexv2/latest/APIReference/API_CreateBotAlias.html) 작업을 설명하는 CloudTrail 로그 항목을 보여줍니다.

```
{
    "eventVersion": "1.05",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "ID of caller:temporary credentials",
        "arn": "arn:aws:sts::111122223333:assumed-role/role name/role ARN",
        "accountId": "111122223333",
        "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
        "sessionContext": {
            "sessionIssuer": {
                "type": "Role",
                "principalId": "ID of caller",
                "arn": "arn:aws:iam::111122223333:role/role name",
                "accountId": "111122223333",
                "userName": "role name"
            },
            "webIdFederationData": {},
            "attributes": {
                "mfaAuthenticated": "false",
                "creationDate": "creation date"
            }
        }
    },
    "eventTime": "event timestamp",
    "eventSource": "lex.amazonaws.com",
    "eventName": "CreateBotAlias",
    "awsRegion": "Region",
    "sourceIPAddress": "192.0.2.0",
    "userAgent": "user agent",
    "requestParameters": {
        "botAliasLocaleSettingsMap": {
            "en_US": {
                "enabled": true
            }
        },
        "botId": "bot ID",
        "botAliasName": "bot aliase name",
        "botVersion": "1"
    },
    "responseElements": {
        "botAliasLocaleSettingsMap": {
            "en_US": {
                "enabled": true
            }
        },
        "botAliasId": "bot alias ID",
        "botAliasName": "bot alias name",
        "botId": "bot ID",
        "botVersion": "1",
        "creationDateTime": creation timestamp
    },
    "requestID": "unique request ID",
    "eventID": "unique event ID",
    "readOnly": false,
    "eventType": "AwsApiCall",
    "recipientAccountId": "111122223333"
}
```