Artificial Intelligence
Monitor AWS Quick and Kiro usage and adoption across your organizationWhen leadership asks who uses AWS Quick and Kiro, how much, and where agent hours go, you need answers that trace back to records. Administrators also ask for agent hours by team, which supports internal cost allocation by team, and for usage by surface, such as desktop and web.
Quick provides usage datasets that hold those records in your account. A guided, open source setup script delivers four kinds of usage logs to an Amazon Simple Storage Service (Amazon S3) bucket that you own. The logs cover chat activity, agent hours, feedback, and index usage. The script then creates Quick datasets and an optional starter dashboard on them. You can ask the datasets questions in plain language, explore them on the dashboard, and join them with Kiro usage reports and organizational data.
In this post, we show how to set up the usage datasets and ask questions about them. We also cover who can read them, how to extend them with Kiro and organizational data using two additional scripts, and what they can’t answer.
Solution overview
AWS Quick publishes usage events as vended logs. The setup script creates Amazon CloudWatch Logs deliveries that write those events to an S3 bucket that you own. It then creates AWS Glue tables, an Amazon Athena workgroup, and four SPICE datasets: chat activity, agent hours, feedback, and index usage.
Figure 1 shows the flow. The data supports usage reporting and internal cost allocation.
Figure 1: AWS Quick usage data flow from vended logs to Quick datasets
In Figure 1, Kiro reports in S3 and AWS IAM Identity Center users become datasets that join the base datasets and feed additional dashboards.
Run the script in each Region that you report on. Logging starts when setup finishes (Monitoring AWS Quick using CloudWatch Logs). When enabled, the daily schedule refreshes each dataset in full at 02:00 UTC, and you can choose Refresh now for sooner results.
Prerequisites and access
You need the following:
- An AWS account with AWS Quick in the Region that you want to report on, such as us-east-1.
- A Quick user with the Admin or Admin Pro role, who becomes the dataset owner.
- A role in the same account with the right permissions to run the script. The script creates S3 buckets, CloudWatch Logs deliveries, Athena and AWS Glue resources, IAM policies, and Quick resources.
- The setup script from the GitHub repository.
The logs identify people, because each user_arn includes the Quick username, often an email address. IAM access and Quick sharing are separate. Anyone with IAM access to the bucket can read the records. In Quick, only the dataset owner can use the datasets and dashboard until you share them, and every viewer then sees individual activity.
Setting the default access policy to Deny is optional and applies to the whole Quick account. Users and groups without an IAM policy assignment lose access to the S3, Athena, Amazon Redshift, and Amazon Relational Database Service (Amazon RDS) data they use today, administrators included. You can switch back to Allow at any time.
Set up, verify, and ask a question
In AWS CloudShell in the same Region, choose Actions, then Upload file, and upload quick_usage_datasets_setup.py. Preview, then run:
python3 quick_usage_datasets_setup.py --dry-run
python3 quick_usage_datasets_setup.py --region us-east-1
Confirm your account ID, then enter the phrase that each step shows, such as CREATE BUCKET. The retention prompt sets how many days logs stay in a new bucket, 365 by default. --bucket reuses a bucket that you own, and the script adds files only under quick-usage-analytics/. For default access, enter DENY DEFAULT ACCESS or SKIP AND ACCEPT EXPOSURE.
To verify the setup, check the following:
- Delivery: Run
aws s3 ls s3://<BUCKET_NAME>/quick-usage-analytics/ --recursiveand look for.log.gzfiles under each dataset prefix. - Ingestion: After 10 to 15 minutes, choose Refresh now on each
quick-usage-*dataset and confirm that it loads rows. - Viewer access: Open the dashboard as an intended viewer, and confirm that someone you didn’t share it with can’t.
Now ask a question with a defined metric and period. In Quick chat, ask: “How many chat messages did distinct users send in the reporting period?” A message is one chat record, and users are distinct user_arn values. To reconcile the answer, count the same records in Athena for the same dates as the dashboard filters:
SELECT count(*) AS messages, count(DISTINCT user_arn) AS users
FROM quick_usage_chat
WHERE from_unixtime(CAST(event_timestamp AS bigint) / 1000) >= TIMESTAMP '<START_DATE> 00:00:00'
AND from_unixtime(CAST(event_timestamp AS bigint) / 1000) < TIMESTAMP '<DAY_AFTER_END_DATE> 00:00:00';
In the example, Athena returned 970 messages from 8 users, matching the Messages and Active users tiles in Figure 2. The figures use one reporting period and the Month time scale, so each tile covers the whole period.
Figure 2: Chat adoption and performance sheet
For feedback, the Not Useful share is Not Useful ratings divided by all ratings in the period. In the example, Figure 3 shows 227 ratings, and 23.3% (53) were Not Useful. Athena returned the same counts.
Figure 3: Feedback sheet
Figure 4 shows agent hours by service.
Figure 4: Agent hours sheet
Add Kiro usage
After the base setup, an additional script adds Kiro usage. You need a Kiro profile in the same account, Kiro administrator permissions, and CloudShell in that profile’s Region.
python3 kiro_usage_datasets_setup.py
The script creates the kiro-usage-* datasets and the AWS Quick and Kiro usage dashboard. Kiro reports one row for each user, day, and client, so count distinct users, not rows, for monthly reporting.
The kiro-usage-quick_kiro_by_user dataset holds one row for each user and day, joined on user_id. Identities from a different identity store appear as two rows, and records with an empty user_id can’t match. In the example, kiro-usage-user_report loaded the same 399 rows as the files (Figure 5).
Figure 5: Kiro usage user report dataset
Add organizational context
A second script adds organizational context. Quick must authenticate through AWS IAM Identity Center, and your users need their organizational fields filled in.
python3 quick_usage_org.py
The script creates quick-org-identity-center-users, a quick-usage-<dataset>-with-org copy of each usage dataset, and the AWS Quick usage by organization dashboard. Only the -with-org datasets receive the org_ attributes, such as cost center and department. They refresh with the usage data, but the attributes change only when you rerun quick_usage_org.py. The user dataset is personal data.
Figure 6 shows the organization dashboard, which adds division, department, and cost center filters to each sheet.
Figure 6: AWS Quick usage by organization dashboard
Costs and cleanup
Costs come from Athena scans for each refresh, SPICE capacity, S3 storage, and CloudWatch Logs delivery (Quick, Athena, S3, and Amazon CloudWatch pricing). In one example week, the logs were about 89 KB, the datasets used about 0.3 MB of SPICE capacity, and a daily refresh scanned about 77 KB in Athena.
To clean up, run --destroy on the Kiro and organization scripts first, because they read the base datasets. Then run this command:
python3 quick_usage_datasets_setup.py --destroy
Each removal asks for its own phrase. It deletes the starter analysis and dashboard, including your customizations. It deletes the log files under quick-usage-analytics/, keeps a bucket that you brought, and leaves the delivery statement in the bucket policy. Deleted usage logs can’t be recovered.
Conclusion
We showed how to set up the AWS Quick usage datasets and ask questions about them in natural language. We also covered the starter dashboard, who can read the data, and where the data stops. For more information about index storage, see Monitor index storage usage. To start, use the GitHub repository and its README. To run your own pipeline, see Build an enterprise observability solution for AWS Quick.
AI Trends