

AWS Chatbot is now Amazon Q Developer. [Learn more](service-rename.md)

# Monitoring Amazon Q Developer in chat applications


Monitoring is an important part of maintaining the availability of Amazon Q Developer in chat applications and your other AWS solutions. AWS provides the following monitoring tools to watch Amazon Q Developer in chat applications, report when something is wrong, and take automatic actions when appropriate:
+ *Amazon CloudWatch* monitors your AWS resources and the applications you run on AWS in real time. You can collect and track metrics, create customized dashboards, and set alarms that notify you or take actions when a specified metric reaches a threshold that you specify. For example, you can have CloudWatch track CPU usage or other metrics of your Amazon EC2 instances and automatically launch new instances when needed. For more information, see the [Amazon CloudWatch User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html).
+ *Amazon CloudWatch Logs* enables you to monitor, store, and access your log files from Amazon EC2 instances, CloudTrail, and other sources. CloudWatch Logs can monitor information in the log files and notify you when certain thresholds are met. You can also archive your log data in highly durable storage. For more information, see the [Amazon CloudWatch Logs User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html).
+ *AWS CloudTrail* captures API calls and related events made by or on behalf of your AWS account and delivers the log files to an Amazon S3 bucket that you specify. You can identify which users and accounts called AWS, the source IP address from which the calls were made, and when the calls occurred. For more information, see the [AWS CloudTrail User Guide](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html).

# Monitoring Amazon Q Developer in chat applications with Amazon CloudWatch
Monitoring with CloudWatch

You can monitor Amazon Q Developer in chat applications using CloudWatch, which collects raw data and processes it into readable, near real-time metrics. These statistics are kept for 15 months, so that you can access historical information and gain a better perspective on how your web application or service is performing. You can also set alarms that watch for certain thresholds, and send notifications or take actions when those thresholds are met. For more information, see the [Amazon CloudWatch User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html).

## Enabling CloudWatch Metrics


Amazon CloudWatch metrics are enabled by default.

## Available metrics and dimensions


The metrics and dimensions that Amazon Q Developer in chat applications sends to Amazon CloudWatch are listed below.

The `AWS/Chatbot` namespace includes the following metrics.

**Note**  
To get Amazon Q Developer in chat applications metrics, you must specify **US East (N. Virginia)** for the Region.


| Metric | Description | 
| --- | --- | 
|  `EventsThrottled`  |  The number of throttled notifications. Events may be throttled if the number of events received exceeds 10 per second. Units: Count  | 
|  `EventsProcessed`  |  The number of event notifications received by Amazon Q Developer in chat applications. Units: Count  | 
|  `UnsupportedEvents`  |  The number of unsupported events or messages attempted. For a full list of AWS services supported by Amazon Q Developer in chat applications, see [Monitoring AWS services using Amazon Q Developer in chat applications](related-services.md). Units: Count  | 
|  `MessageDeliverySuccess`  |  The number of messages successfully delivered to the chat client. Units: Count  | 
|  `MessageDeliveryFailure`  |  The number of messages that failed to deliver to the chat client. Units: Count  | 

Amazon Q Developer in chat applications sends the following dimensions to CloudWatch.


| Dimension | Description | 
| --- | --- | 
| `ConfigurationName` |  This dimension filters the data you request by the name of your configuration.  | 

## Viewing Amazon Q Developer in chat applications metrics


You can view metrics in the CloudWatch console, which provides a fine-grained and customizable display of your resources, as well as the number of running tasks in a service.

### Viewing Amazon Q Developer in chat applications metrics in the CloudWatch console


Amazon Q Developer in chat applications metrics can be viewed in the CloudWatch console. The CloudWatch console provides a detailed view of Amazon Q Developer in chat applications metrics, and you can tailor the views to suit your needs. For more information about CloudWatch, see the [Amazon CloudWatch User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html).

**To view metrics in the CloudWatch console**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1. In the **Metrics** section in the left navigation, choose **Amazon Q Developer in chat applications**.

1. Choose the metrics to view. 

# Accessing Amazon CloudWatch Logs for Amazon Q Developer in chat applications
CloudWatch Logs

**Note**  
AWS Chatbot has integrated with Amazon Q Developer. [Learn more](service-rename.md)

AWS provides event logging with Amazon CloudWatch Logs. With CloudWatch Logs for Amazon Q Developer in chat applications, you can see all the events handled by Amazon Q Developer in chat applications. You can also see details of any error that may have prevented a notification from appearing in your Amazon Chime or Slack chat room.

Possible errors that you can see with CloudWatch Logs include lack of permissions, unsupported events, and events throttled by the chat client. For more information about these errors, see [Troubleshooting Amazon Q Developer in chat applications](chatbot-troubleshooting.md).

Amazon Q Developer in chat applications also provides an audit log of commands executed by Amazon Q Developer in chat applications in CloudWatch Logs. With CloudWatch Logs' audit log events for Amazon Q Developer in chat applications, you can see an audit log of executed commands and their chat workspace ID, channel ID, and channel user ID attributes. The audit log events in CloudWatch Logs are always enabled and can't be disabled.

Amazon Q Developer in chat applications always logs audit events for command execution to CloudWatch Logs. You can choose to enable logging for all events, or only for errors.

**Note**  
There is an additional charge for using CloudWatch Logs. For more details, see [Amazon CloudWatch Pricing](https://aws.amazon.com/cloudwatch/pricing).

## Enabling CloudWatch Logs


You can enable CloudWatch Logs during the setup flow of your Amazon Chime, Microsoft Teams, or Slack channel configuration. For existing channels, you can edit the configuration to enable logging.

**To enable CloudWatch Logs for a new configuration**

1. On the **Configure channel** page, during the setup flow, under **Configuration details**, choose **Send logs to CloudWatch.**

1. Choose either **All events** or **Errors only**.

1. Continue the setup flow, then choose **Configure channel**.

**To enable CloudWatch Logs for an existing configuration**

1. In the Amazon Q Developer in chat applications console, under **Configured clients**, navigate to the chat client you want to edit.

1. From the list of existing configurations, choose the configuration you want to edit, then choose **Edit**.

1. On the **Edit** page, choose **Send logs to CloudWatch.**

1. Choose either **All events** or **Errors only**.

1. Choose **Save**.

## Viewing CloudWatch Logs


Your Amazon Q Developer in chat applications logs will be sent to CloudWatch under a designated CloudWatch Logs group for your configuration. The group name is **/aws/chatbot/**configuration-name****. To learn more about log groups and other CloudWatch concepts such as log events and log streams, see [Amazon CloudWatch Logs Concepts](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogsConcepts.html) in the *Amazon CloudWatch Logs User Guide*.

You can view your logs in the Amazon CloudWatch console. Note that you must specify **US East (N. Virginia)** for the Region. For more information, see [View Log Data Sent to CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#ViewingLogData) in the *Amazon CloudWatch Logs User Guide*.

# Logging Amazon Q Developer in chat applications API calls with AWS CloudTrail


**Note**  
AWS Chatbot has integrated with Amazon Q Developer. [Learn more](service-rename.md)

Amazon Q Developer in chat applications integrates events with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in Amazon Q Developer in chat applications. CloudTrail captures API calls for Amazon Q Developer in chat applications as events. The calls captured include calls from the Amazon Q Developer in chat applications console and code calls to the Amazon Q Developer in chat applications API operations. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for Amazon Q Developer in chat applications. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in **Event history**. Using the information collected by CloudTrail, you can determine the request that was made to Amazon Q Developer in chat applications, the IP address from which the request was made, who made the request, when it was made, and additional details. For more information, see [Viewing Events with CloudTrail Event History](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html). 

To learn more about CloudTrail, including how to configure and enable it, see the [AWS CloudTrail User Guide](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/).

When you create a *trail*, you can enable continuous delivery of Amazon Q Developer in chat applications events to an Amazon S3 bucket that you specify. The trail logs events from all Regions in the AWS partition for that service and delivers the log files to that Amazon S3 bucket. You can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs. For more information, see the following topics in the *AWS CloudTrail User Guide*: 
+ [Overview for Creating a Trail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html)
+ [CloudTrail Supported Services and Integrations](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-aws-service-specific-topics.html#cloudtrail-aws-service-specific-topics-integrations)
+ [Configuring Amazon SNS Notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/getting_notifications_top_level.html)
+ [Receiving CloudTrail Log Files from Multiple Regions](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html) and [Receiving CloudTrail Log Files from Multiple Accounts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html)

## Logging Amazon Q Developer in chat applications API information in CloudTrail


Every event log entry contains information about who generated the request. The identity information helps you determine the following: 
+ Whether the request was made with root user or IAM user credentials.
+ Whether the request was made with temporary security credentials for a role or for a federated user.
+ Whether the request was made by another AWS service.

For more information, see the [CloudTrail userIdentity Element](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html).

## Logging other AWS API information in CloudTrail


When you use commands in Amazon Q Developer in chat applications that call APIs from other AWS services, those APIs are logged in CloudTrail as well.

When you run a command that involves another AWS service, Amazon Q Developer in chat applications assumes an IAM role in your account to invoke AWS APIs on your behalf. These APIs appear in your CloudTrail events, and they are associated with the role that was configured for your Amazon Q Developer in chat applications configuration with a session name that includes **chatbot**, such as **chatbot-session**.

Because Amazon Q Developer in chat applications is a global service, it may process your events in a different AWS Region. An API call is logged in the region where the resource behind that API call exists. For example, if you run a `lambda list-functions` command in Amazon Q Developer in chat applications, CloudTrail will log two APIs: **AssumeRole** and **ListFunctions**. The **AssumeRole** call is logged in the Region Amazon Q Developer in chat applications processed it in, and the **ListFunctions** call is logged in the Region the function exists in. 

## Example: Amazon Q Developer in chat applications log file entries


CloudTrail log files contain one or more log entries. An event represents a single request from any source and includes information about the requested action, the date and time of the action, request parameters, user identification, and more. CloudTrail log files aren't an ordered stack trace of the public API calls, so they don't appear in any specific order.

The following example shows a CloudTrail log entry for the Amazon Q Developer in chat applications `DescribeSlackChannels` action.

```
      
{
    "eventVersion": "1.05",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "AIDACKCEVSQ6C2EXAMPLE:jdoe",
        "arn": "arn:aws:sts::111122223333:assumed-role/user/jdoe",
        "accountId": "111122223333",
        "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
        "sessionContext": {
            "attributes": {
                "mfaAuthenticated": "false",
                "creationDate": "2019-08-01T17:24:13Z"
            },
            "sessionIssuer": {
                "type": "Role",
                "principalId": "AIDACKCEVSQ6C2EXAMPLE",
                "arn": "arn:aws:iam::111122223333:role/user",
                "accountId": "111122223333",
                "userName": "jdoe"
            }
        }
    },
    "eventTime": "2019-08-01T23:16:02Z",
    "eventSource": "chatbot.amazonaws.com",
    "eventName": "DescribeSlackChannels",
    "awsRegion": "us-east-2",
    "sourceIPAddress": "10.24.34.3",
    "userAgent": "aws-internal/3 aws-sdk-java/1.11.590 Linux/4.9.137-0.1.ac.218.74.329.metal1.x86_64 OpenJDK_64-Bit_Server_VM/25.212-b03 java/1.8.0_212 vendor/Oracle_Corporation",
    "requestParameters": {
        "SlackTeamId": "XXXXXXXX",
        "MaxResults": 1000
    },
    "responseElements": null,
    "requestID": "543db7ab-b4b2-11e9-8925-d139e92a1fe8",
    "eventID": "5b2805a5-3e06-4437-a7a2-b5fdb5cbb4e2",
    "readOnly": true,
    "eventType": "AwsApiCall",
    "recipientAccountId": "111122223333"
}
```

The following example shows a CloudTrail log entry for a `DescribeSlackWorkspaces` action.

```
{
    "eventVersion": "1.05",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "AIDACKCEVSQ6C2EXAMPLE:jdoe",
        "arn": "arn:aws:sts::111122223333:assumed-role/user/jdoe",
        "accountId": "111122223333",
        "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
        "sessionContext": {
            "attributes": {
                "mfaAuthenticated": "false",
                "creationDate": "2019-08-07T16:11:27Z"
            },
            "sessionIssuer": {
                "type": "Role",
                "principalId": "AIDACKCEVSQ6C2EXAMPLE",
                "arn": "arn:aws:iam::111122223333:role/user",
                "accountId": "111122223333",
                "userName": "jdoe"
            }
        }
    },
    "eventTime": "2019-08-07T17:46:26Z",
    "eventSource": "chatbot.amazonaws.com",
    "eventName": "DescribeSlackWorkspaces",
    "awsRegion": "us-east-2",
    "sourceIPAddress": "10.24.34.3",
    "userAgent": "aws-internal/3 aws-sdk-java/1.11.590 Linux/4.9.137-0.1.ac.218.74.329.metal1.x86_64 OpenJDK_64-Bit_Server_VM/25.212-b03 java/1.8.0_212 vendor/Oracle_Corporation",
    "requestParameters": null,
    "responseElements": null,
    "requestID": "476570da-b93b-11e9-af41-a744734236af",
    "eventID": "3f061095-b488-43d4-becc-f8652d459ac5",
    "readOnly": true,
    "eventType": "AwsApiCall",
    "recipientAccountId": "111122223333"
}
```