

# Viewing the activity of specific users in Amazon Q Developer
<a name="q-admin-user-telemetry"></a>

You can configure Amazon Q to collect user activity telemetry of individual Amazon Q Developer subscribers in your organization and present that information in a report. The report gives you insights into how specific users are using Amazon Q.

Amazon Q generates the report every day at midnight (00:00) Coordinated Universal Time (UTC), and saves it in a CSV file at the following path:

`s3://bucketName/prefix/AWSLogs/accountId/QDeveloperLogs/by_user_analytic/region/year/month/day/00/accountId_by_user_analytic_timestamp.csv`

The CSV file is laid out as follows:
+ Each row shows a user who interacted with Amazon Q that day.
+ Each column shows a metric, as described in [User activity report metrics](user-activity-metrics.md). Metrics are calculated based on the user telemetry collected over the course of the day.

If more than 1,000 users interact with Amazon Q during the day, Amazon Q splits the data into several CSV files containing 1,000 users each, and having suffixes of `part_1`, `part_2`, and so on.

**Note**  
When you enable user activity reports, Amazon Q collects telemetry regardless of how a developer has set the **Enable Amazon Q to send usage data to AWS** setting in their IDE. That setting controls whether telemetry can be used by the *AWS corporation*, not your organization. For more information about this setting, see [Opting out of sharing your client-side telemetry](opt-out-IDE.md#opt-out-IDE-telemetry).

Use the following instructions to enable user activity reports.

**Prerequisite**

Create an Amazon S3 bucket to hold the user activity report CSV file. The bucket must:
+ Be in the AWS Region where the Amazon Q Developer profile was installed. This profile was installed when you subscribed IAM Identity Center workforce users to Amazon Q Developer Pro for the first time. For more information about this profile and the Regions where it's supported, see [What is the Amazon Q Developer profile?](subscribe-understanding-profile.md), and [Supported Regions for the Q Developer console and Q Developer profile](q-admin-setup-subscribe-regions.md#qdev-console-and-profile-regions).
+ Be in the AWS account where users are subscribed. If users are subscribed in multiple AWS accounts, then you must create buckets in each of those accounts. Cross-account buckets are not supported.
+ (Optional but recommended) Be different from the bucket you might be using for [prompt logging](q-admin-prompt-logging.md).
+ Include a prefix, also known as a subfolder, where Amazon Q will save the CSV file. The CSV file cannot be saved in the root of the bucket.
+ Have a bucket policy like the one that follows. Replace *bucketName*, *region*, *accountId*, and *prefix* with your own information.

------
#### [ JSON ]

****  

  ```
  {
      "Version":"2012-10-17",		 	 	 
      "Statement": [
          {
              "Sid": "QDeveloperLogsWrite",
              "Effect": "Allow",
              "Principal": {
                  "Service": "q.amazonaws.com"
              },
              "Action": [
                  "s3:PutObject"
              ],
              "Resource": [
                  "arn:aws:s3:::bucketName/prefix/*"
              ],
              "Condition": {
                  "StringEquals": {
                      "aws:SourceAccount": "111122223333"
                  },
                  "ArnLike": {
                      "aws:SourceArn": "arn:aws:codewhisperer:us-east-1:111122223333:*"
                  }
              }
          }
      ]
  }
  ```

------

  If you're configuring SSE-KMS on the bucket, add the below policy on the KMS key:

  ```
  {
      "Effect": "Allow",
      "Principal": {
          "Service": "q.amazonaws.com"
      },
      "Action": "kms:GenerateDataKey",
      "Resource": "*",
      "Condition": {
          "StringEquals": {
            "aws:SourceAccount": "accountId" 
          },
          "ArnLike": {
             "aws:SourceArn": "arn:aws:codewhisperer:region:accountId:*"
          }
      }
  }
  ```

  To learn about protecting the data in your Amazon S3 bucket, see [Protecting data with encryption](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingEncryption.html) in the *Amazon Simple Storage Service User Guide*.

**To enable user activity reports**

1. Open the Amazon Q Developer console.

   To use the Amazon Q Developer console, you must have the permissions defined in [Allow administrators to use the Amazon Q Developer console](id-based-policy-examples-admins.md#q-admin-setup-admin-users).

1. Choose **Settings**.

1. Under **Q Developer user activity reports**, choose **Edit**.

1. Toggle **Collect granular metrics per user**.

1. Under **S3 location**, enter the Amazon S3 URI that you will use to hold the CSV reports. Example: `s3://amzn-s3-demo-bucket/user-activity-reports/`

# User activity report metrics
<a name="user-activity-metrics"></a>

The following table describes the metrics that are included in the user activity reports generated by Amazon Q Developer.

For more information about these reports, see [Viewing the activity of specific users in Amazon Q Developer](q-admin-user-telemetry.md).


| Metric name | Description | 
| --- | --- | 
|  Chat\$1AICodeLines  |  Lines of code suggested by Amazon Q and accepted by the user. This metric includes code that was generated through the [Amazon Q chat](q-in-IDE-chat.md) (not [inline chat](q-in-IDE-inline-chat.md)) and inserted into the IDE.   | 
|  Chat\$1MessagesInteracted  |  Number of chat messages where the user has interacted positively with Amazon Q. Examples of positive interactions: clicking a link, inserting a suggestion, and upvoting a response from Amazon Q. This metric includes messages that were generated by [Amazon Q chat](q-in-IDE-chat.md) (not [inline chat](q-in-IDE-inline-chat.md)).   | 
|  Chat\$1MessagesSent  |  Number of messages sent to and from Amazon Q. This metric includes the user prompts and Amazon Q responses in the [Amazon Q chat](q-in-IDE-chat.md) (not [inline chat](q-in-IDE-inline-chat.md)).   | 
|  CodeFix\$1AcceptanceEventCount  |  Number of code fixes suggested by Amazon Q and accepted by the user. This metric applies to code fixes generated through the [code review feature](code-reviews.md).  | 
|  CodeFix\$1AcceptedLines  |  Lines of code suggested by Amazon Q and accepted by the user. This metric applies to lines of code generated through the [code review feature](code-reviews.md).  | 
|  CodeFix\$1GeneratedLines  |  Lines of code suggested by Amazon Q. This metric applies to lines of code generated through the [code review feature](code-reviews.md).  | 
|  CodeFix\$1GenerationEventCount  |  Number of code fixes suggested by Amazon Q. This metric applies to code fixes generated through the [code review feature](code-reviews.md).  | 
|  CodeReview\$1FailedEventCount  |  Number of code issues that were found but for which Amazon Q could not suggest a code fix. This metric applies to code issues generated using the [code review feature](code-reviews.md).  | 
|  CodeReview\$1FindingsCount  |  Number of code issues found by Amazon Q. This metric applies to code issues found using the [code review feature](code-reviews.md).  | 
|  CodeReview\$1SucceededEventCount  |  Number of code issues that were found and for which Amazon Q was able to generate a suggested code fix. This metric applies to code issues found using the [code review feature](code-reviews.md).  | 
|  Dev\$1AcceptanceEventCount  |  Number of code features suggested by Amazon Q and accepted by the user. This metric applies to code features generated through the [/dev command](q-in-IDE-chat.md#develop-code).  | 
|  Dev\$1AcceptedLines  |  Lines of code suggested by Amazon Q and accepted by the user. This metric applies to lines of code generated through the [/dev command](q-in-IDE-chat.md#develop-code).  | 
|  Dev\$1GeneratedLines  |  Lines of code suggested by Amazon Q. This metric applies to lines of code generated through the [/dev command](q-in-IDE-chat.md#develop-code).  | 
|  Dev\$1GenerationEventCount  |  Number of code features suggested by Amazon Q. This metric applies to code features generated through the [/dev command](q-in-IDE-chat.md#develop-code).  | 
|  DocGeneration\$1AcceptedFileUpdates  |  Number of file updates suggested by Amazon Q and accepted by the user. This metric applies to file updates generated through the [/doc command](q-in-IDE-chat.md#doc-generation).  | 
|  DocGeneration\$1AcceptedFilesCreations  |  Number of file creations suggested by Amazon Q and accepted by the user. This metric applies to file creations generated through the [/doc command](q-in-IDE-chat.md#doc-generation).  | 
|  DocGeneration\$1AcceptedLineAdditions  |  Lines of documentation additions suggested by Amazon Q and accepted by the user. This metric applies to documentation generated through the [/doc command](q-in-IDE-chat.md#doc-generation).  | 
|  DocGeneration\$1AcceptedLineUpdates  |  Lines of documentation updates suggested by Amazon Q and accepted by the user. This metric applies to documentation generated using the [/doc command](q-in-IDE-chat.md#doc-generation).  | 
|  DocGeneration\$1EventCount  |  Number of times the user engaged with Amazon Q using the [/doc command](q-in-IDE-chat.md#doc-generation).   | 
|  DocGeneration\$1RejectedFileCreations  |  Number of file creations suggested by Amazon Q and rejected by the user. This metric applies to file creations generated through the [/doc command](q-in-IDE-chat.md#doc-generation).  | 
|  DocGeneration\$1RejectedFileUpdates  |  Number of file updates suggested by Amazon Q and rejected by the user. This metric applies to file updates generated through the [/doc command](q-in-IDE-chat.md#doc-generation).  | 
|  DocGeneration\$1RejectedLineAdditions  |  Lines of documentation additions suggested by Amazon Q and rejected by the user. This metric applies to documentation generated through the [/doc command](q-in-IDE-chat.md#doc-generation).  | 
|  DocGeneration\$1RejectedLineUpdates  |  Lines of documentation updates suggested by Amazon Q and rejected by the user. This metric applies to documentation generated using the [/doc command](q-in-IDE-chat.md#doc-generation).  | 
|  InlineChat\$1AcceptedLineAdditions  |  Lines of code additions suggested by Amazon Q and accepted by the user. This metric includes code additions generated through the [inline chat](q-in-IDE-inline-chat.md) (not [Amazon Q chat](q-in-IDE-chat.md)).  | 
|  InlineChat\$1AcceptedLineDeletions  |  Lines of code deletions suggested by Amazon Q and accepted by the user. This metric includes code deletions suggested through the [inline chat](q-in-IDE-inline-chat.md) (not [Amazon Q chat](q-in-IDE-chat.md)).  | 
|  InlineChat\$1AcceptanceEventCount  |  Number of [inline chat](q-in-IDE-inline-chat.md) (not [Amazon Q chat](q-in-IDE-chat.md)) suggestions that were accepted by the user.  | 
|  InlineChat\$1DismissalEventCount  |  Number of [inline chat](q-in-IDE-inline-chat.md) (not [Amazon Q chat](q-in-IDE-chat.md)) suggestions that were abandoned by the user. By 'abandoned', we mean that the code suggestion was displayed but the user kept typing or performing other operations in their IDE, and did not explicitly accept or reject the code suggestion.  | 
|  InlineChat\$1DismissedLineAdditions  |  Lines of code additions suggested by Amazon Q and abandoned by the user. By 'abandoned', we mean that the code suggestion was displayed but the user kept typing or performing other operations in their IDE, and did not explicitly accept or reject the code suggestion. This metric includes code additions generated through the [inline chat](q-in-IDE-inline-chat.md) (not [Amazon Q chat](q-in-IDE-chat.md)).  | 
|  InlineChat\$1DismissedLineDeletions  |  Lines of code deletions suggested by Amazon Q and abandoned by the user. By 'abandoned', we mean that the code suggestion was displayed but the user kept typing or performing other operations in their IDE, and did not explicitly accept or reject the code suggestion. This metric includes code deletions suggested through the [inline chat](q-in-IDE-inline-chat.md) (not [Amazon Q chat](q-in-IDE-chat.md)).  | 
|  InlineChat\$1EventCount  |  Number of [inline chat](q-in-IDE-inline-chat.md) (not [Amazon Q chat](q-in-IDE-chat.md)) sessions that the user engaged in.  | 
|  InlineChat\$1RejectedLineAdditions  |  Lines of code additions suggested by Amazon Q and rejected by the user. This metric includes code additions generated through the [inline chat](q-in-IDE-inline-chat.md) (not [Amazon Q chat](q-in-IDE-chat.md)).  | 
|  InlineChat\$1RejectedLineDeletions  |  Lines of code deletions suggested by Amazon Q and rejected by the user. This metric includes code deletions suggested through the [inline chat](q-in-IDE-inline-chat.md) (not [Amazon Q chat](q-in-IDE-chat.md)).  | 
|  InlineChat\$1RejectionEventCount  |  Number of [inline chat](q-in-IDE-inline-chat.md) (not [Amazon Q chat](q-in-IDE-chat.md)) suggestions that were rejected by the user.  | 
|  Inline\$1AICodeLines  |  Lines of code suggested by Amazon Q and accepted by the user. This metric includes code that was accepted as [inline suggestions](inline-suggestions.md).  | 
|  Inline\$1AcceptanceCount  |  Number of [inline suggestions](inline-suggestions.md) accepted by the user.  | 
|  Inline\$1SuggestionsCount  |  Number of [inline suggestions](inline-suggestions.md) displayed to the user.  | 
|  TestGeneration\$1AcceptedLines  |  Lines of code suggested by Amazon Q and accepted by the user. This metric applies to lines of code generated through the [/test command](q-in-IDE-chat.md#unit-tests).  | 
|  TestGeneration\$1AcceptedTests  |  Number of unit tests suggested by Amazon Q and accepted by the user. This metric applies to unit tests generated through the [/test command](q-in-IDE-chat.md#unit-tests).  | 
|  TestGeneration\$1EventCount  |  Number of times the user engaged with Amazon Q through the [/test command](q-in-IDE-chat.md#unit-tests).   | 
|  TestGeneration\$1GeneratedLines  |  Lines of code suggested by Amazon Q. This metric applies to lines of code generated through the [/test command](q-in-IDE-chat.md#unit-tests).  | 
|  TestGeneration\$1GeneratedTests  |  Number of unit tests suggested by Amazon Q. This metric applies to unit tests generated through the [/test command](q-in-IDE-chat.md#unit-tests).  | 
|  Transformation\$1EventCount  |  Number of times the user engaged with Amazon Q through the [/transform command](transform-in-IDE.md), excluding the times when the when the user [transformed code on the command line](transform-CLI.md).  | 
|  Transformation\$1LinesGenerated  |  Lines of code suggested by Amazon Q. This metric applies to code generated through the [/transform command](transform-in-IDE.md), excluding code [transformed on the command line](transform-CLI.md).  | 
|  Transformation\$1LinesIngested  |  Lines of code provided to Amazon Q for transformation. This metric applies to code that is provided through the [/transform command](transform-in-IDE.md), excluding code provided for [transformation on the command line](transform-CLI.md), or for an [SQL conversion](transform-sql.md).  | 