监控组织内 AWS Quick 和 Kiro 使用与采用

当管理层询问谁在使用 AWS Quick 和 Kiro、使用量多少、智能体小时数流向何处时,你需要能够追溯至记录的答案。管理员还会要求按团队查看智能体小时数,这支持按团队进行内部成本分摊,也会要求按使用界面(例如桌面端和 Web 端)查看使用情况。
Quick 提供使用数据集,将这些记录保存在你的账户中。一个引导式的开源设置脚本会将四类使用日志投递到你拥有的 Amazon Simple Storage Service(Amazon S3)存储桶。这些日志涵盖聊天活动、智能体小时数、反馈和索引使用情况。该脚本随后会基于它们创建 Quick 数据集以及一个可选的入门仪表板。你可以用自然语言向这些数据集提问,在仪表板上探索它们,并将它们与 Kiro 使用报告和组织数据关联起来。
在本文中,我们展示如何设置这些使用数据集并针对它们提问。我们还会介绍谁可以读取它们、如何使用另外两个脚本用 Kiro 和组织数据扩展它们,以及它们无法回答哪些问题。
AWS Quick 将使用事件发布为 vended logs。设置脚本会创建 Amazon CloudWatch Logs 投递,将这些事件写入你拥有的 S3 存储桶。随后,它会创建 AWS Glue 表、一个 Amazon Athena 工作组,以及四个 SPICE 数据集:聊天活动、智能体小时数、反馈和索引使用情况。
图 1 展示了该流程。这些数据支持使用情况报告和内部成本分摊。
图 1:AWS Quick 使用数据从 vended logs 到 Quick 数据集的流程
在图 1 中,S3 中的 Kiro 报告和 AWS IAM Identity Center 用户会成为数据集,这些数据集与基础数据集关联,并为其他仪表板提供数据。
在你所报告的每个 Region 中运行该脚本。设置完成后即开始记录日志(使用 CloudWatch Logs 监控 AWS Quick)。启用后,每日计划会在 UTC 02:00 对每个数据集进行完整刷新,你也可以选择“立即刷新”以更快获得结果。
你需要准备以下内容:
这些日志会标识出具体人员,因为每个 user_arn 都包含 Quick 用户名,而该用户名往往是电子邮件地址。IAM 访问权限与 Quick 共享是彼此独立的。任何拥有该存储桶 IAM 访问权限的人都能读取这些记录。在 Quick 中,在你共享之前,只有数据集所有者才能使用这些数据集和仪表板;共享之后,每位查看者都会看到个人的活动情况。
将默认访问策略设为 Deny 是可选的,且会作用于整个 Quick 账户。未分配 IAM 策略的用户和群组将失去对其当前使用的 S3、Athena、Amazon Redshift 和 Amazon Relational Database Service (Amazon RDS) 数据的访问权限,管理员也不例外。你可以随时切回 Allow。
在同一 Region 的 AWS CloudShell 中,选择 Actions,再选择 Upload file,上传 quick_usage_datasets_setup.py。预览后运行:
python3 quick_usage_datasets_setup.py --dry-run python3 quick_usage_datasets_setup.py --region us-east-1 确认你的账户 ID,然后输入每个步骤显示的短语,例如 CREATE BUCKET。保留期限提示用于设置日志在新存储桶中的保留天数,默认为 365 天。--bucket 用于复用你拥有的存储桶,脚本只会在 quick-usage-analytics/ 下添加文件。对于默认访问权限,请输入 DENY DEFAULT ACCESS 或 SKIP AND ACCEPT EXPOSURE。
要验证设置,请检查以下各项:
现在提出一个带有明确指标和周期的问题。在 Quick chat 中提问:“在报告周期内,不同用户发送了多少条聊天消息?”一条消息是一条聊天记录,用户是不同的 user_arn 值。要核对答案,在 Athena 中按与仪表板筛选器相同的日期统计相同记录:
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'; 在示例中,Athena 返回了来自 8 位用户的 970 条消息,与图 2 中的 Messages 和 Active users 图块匹配。这些图使用一个报告周期和“月”时间尺度,因此每个图块覆盖整个周期。
图 2:聊天采用与性能表
对于反馈,“Not Useful”占比是“Not Useful”评分除以该周期内所有评分。在示例中,图 3 显示了 227 个评分,其中 23.3%(53 个)为“Not Useful”。Athena 返回了相同的计数。
图 3:反馈表
图 4 显示按服务划分的智能体小时数。
图 4:智能体小时表
在基础设置之后,一个附加脚本会添加 Kiro 用量。你需要同一账户中的 Kiro 配置文件、Kiro 管理员权限,以及该配置文件所在区域的 CloudShell。
python3 kiro_usage_datasets_setup.py 该脚本会创建 kiro-usage-* 数据集以及 AWS Quick 和 Kiro 使用情况仪表板。Kiro 会为每个用户、每天和每个客户端报告一行,因此在进行月度报告时,应统计去重用户数,而不是行数。
kiro-usage-quick_kiro_by_user 数据集为每个用户和每天保存一行,并通过 user_id 关联。来自不同身份存储的身份会显示为两行,而 user_id 为空的记录无法匹配。在示例中,kiro-usage-user_report 加载的行数与文件相同,均为 399 行(图 5)。
图 5:Kiro 使用情况用户报告数据集
第二个脚本会添加组织上下文。Quick 必须通过 AWS IAM Identity Center 进行身份验证,并且你的用户需要填写其组织字段。
python3 quick_usage_org.py 该脚本会创建 quick-org-identity-center-users、每个使用数据集对应的 quick-usage-<dataset>-with-org 副本,以及 AWS Quick 按组织划分的使用情况仪表板。只有 -with-org 数据集会接收 org_ 属性,例如成本中心和部门。它们会随使用数据一起刷新,但只有在你重新运行 quick_usage_org.py 时,属性才会变化。用户数据集属于个人数据。
图 6 显示了组织仪表板,它为每个工作表添加了分部、部门和成本中心筛选器。
图 6:AWS Quick 按组织划分的使用情况仪表板
成本来自每次刷新时的 Athena 扫描、SPICE 容量、S3 存储和 CloudWatch Logs 传输(Quick、Athena、S3 和 Amazon CloudWatch 定价)。在示例中的某一周,日志约为 89 KB,数据集使用了约 0.3 MB 的 SPICE 容量,每日刷新在 Athena 中扫描约 77 KB。
若要清理,请先对 Kiro 脚本和组织脚本运行 --destroy,因为它们会读取基础数据集。然后运行此命令:
python3 quick_usage_datasets_setup.py --destroy 每项删除操作都会要求输入各自的确认短语。它会删除入门分析和仪表板,包括你的自定义内容。它会删除 quick-usage-analytics/ 下的日志文件,保留你自己提供的存储桶,并将交付声明保留在存储桶策略中。已删除的使用日志无法恢复。
我们展示了如何设置 AWS Quick 使用数据集,并以自然语言询问相关问题。我们还介绍了入门仪表板、谁可以读取数据以及数据在何处停止。有关索引存储的更多信息,请参阅《监控索引存储用量》。要开始使用,请使用 GitHub 仓库及其 README。要运行你自己的流水线,请参阅《为 AWS Quick 构建企业可观测性解决方案》。
Mohit 是 AWS 技术外部服务高级产品经理,负责 AWS Quick 的分析与治理工作。他的工作通过管理员可观测性、运营洞察和智能体使用分析,让企业管理员清晰了解 AI 智能体和分析在其组织中的使用情况。他还为企业客户提供大规模采用 AI 智能体所需的控制措施,涵盖访问权限和防护机制到模型管理、数据丢失防护和使用限制。Mohit 自 2019 年起加入 Amazon。
Vineet 是 AWS 的高级全球智能体式 AI 解决方案架构师,专注于 AWS Quick。他与企业客户和合作伙伴密切合作,设计、部署并扩展智能体式 AI 驱动的解决方案。Vineet 还共同领导了 AWS for Legal Tech 计划,帮助法律与合规组织利用 AI/ML 创造业务价值。他热爱构建和捣鼓智能体式 AI 解决方案,并自认是一名终身学习者。Vineet 经常在 AWS 活动和行业会议上发表演讲,分享他在生成式 AI 和智能体架构方面的专业知识。
Eyal 是 AWS Quick 的一名软件开发人员。他热衷于拓展 GenAI 产品的边界,以造福 AWS 客户。此前,他曾致力于在“Just Walk Out”商店中实现自主购物。Eyal 始终乐于用最新的前沿技术赋能客户。
Ram 是 AWS 的一名软件开发工程师,为 AWS Quick 进行构建。自 2025 年加入 Amazon 以来,他已在 Quick 的多个部分交付了功能,如今他继续在分析与可观测性方面开展这项工作。他喜欢从事创新项目,弥合前沿 AI 与客户真正需求之间的差距。
原文较长,译文为节选;译文由英文原文机器翻译,术语按行业惯例统一,可在文末展开原文核对。
查看英文原文(Monitor AWS Quick and Kiro usage and adoption across your organization)
When 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.
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.
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 4 shows agent hours by service.
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).
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.
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.
About the authors
Mohit Banka
Mohit is a Senior Product Manager – Technical External Services at AWS, where he works on analytics and governance for AWS Quick. His work gives enterprise administrators clear visibility into how AI agents and analytics are used across their organizations, through admin observability, operational insights, and agent usage analytics. He also provides enterprise customers the controls they need to adopt AI agents at scale, from access permissions and guardrails to model management, data loss prevention, and usage limits. Mohit has been at Amazon since 2019.
Vineet Kachhawaha
Vineet is a Sr. Worldwide Agentic AI Solution Architect at AWS, focused on AWS Quick. He works closely with enterprise customers and partners to design, deploy, and scale agentic AI-driven solutions. Vineet also co-led the AWS for Legal Tech initiative, helping legal and compliance organizations harness AI/ML to drive business value. He loves building and tinkering with agentic AI solutions and considers himself a lifelong learner. Vineet regularly speaks at AWS events and industry conferences, sharing his expertise on generative AI and agentic architectures.
Eyal Shalev
Eyal is a software developer on AWS Quick. He is passionate about expanding the frontier of GenAI products for the benefit of AWS customers. Previously worked to deliver autonomous shopping in “Just Walk Out” stores. Eyal is always excited to empower customers with the latest cutting edge tech.
Ram Khoury
Ram is a Software Development Engineer at AWS, building for AWS Quick. Since joining Amazon in 2025, he has delivered features across several parts of Quick, and he now continues that work on analytics and observability. He enjoys working on innovative projects that bridge the gap between cutting-edge AI and what customers really need.
Tohar Gilbar
Tohar is a Software Development Engineer on AWS Quick. He has worked on the product since its early proof-of-concept versions and now focuses on giving administrators visibility into how it’s used. Outside of work, he’s a proud dad and enjoys a quick game of chess whenever he can.
正文保留英文原文,标题与摘要由机器翻译。
原文发布于 AWS Machine Learning(Monitor AWS Quick and Kiro usage and adoption across your organization),标题、摘要与正文由机器翻译,术语按行业惯例统一,未经人工逐句校订。




