Overview
The analytics system provides insights into:- Bot usage patterns and popularity
- User activity and costs
- Model usage and token consumption
- Satisfaction metrics and feedback
- Cost allocation across users and bots
Analytics data is based on S3 exports from DynamoDB, which are performed hourly. The latest conversations may not be immediately reflected in analytics.
Cost Summary
Get an overall cost summary for a specific period:Response Structure
User Analytics
Get All Users with Usage
limit: Maximum number of users (≤ 1000)start: Start datetime in formatYYYYMMDDHHend: End datetime in formatYYYYMMDDHHinclude_all: If true, includes users with no usage data
Get User Cost Allocation
Bot Analytics
Get Public Bots Usage
- Bot ID, title, and description
- Whether the bot is published as an API
- Shared scope and status
- Owner user ID
- Total price for the period
Bots that have not been used during the specified period will not be listed.
Get Bot Analytics Details
- Total query count
- Number of unique users
- Average satisfaction score
- Total cost
- Daily usage breakdown with:
- Date
- Query count per day
- Unique users per day
- Cost per day
Popular Queries
Identify the most common queries for a bot:Satisfaction Metrics
Conversation Data Export
Conversation logs are stored in S3 and can be queried using Amazon Athena.Database and Table Names
Default environment:- Database:
bedrockchatstack_usage_analysis - Table:
ddb_export
- Database:
dev_bedrockchatstack_usage_analysis - Table:
dev_ddb_export
Query Conversations by Bot ID
https://xxxx.cloudfront.net/admin/bot/<bot-id>
Query Conversations by User ID
Feedback Loop
The feedback loop feature helps analyze why LLM outputs may not meet user expectations.How it Works
- Users provide feedback on LLM responses
- Feedback is stored in the
MessageMapattribute - Administrators analyze feedback patterns
- Adjustments are made to:
- Bot instructions and prompts
- RAG data sources
- Model parameters
Analyzing Feedback with Athena
TheMessageMap field in query results contains user feedback data. You can analyze this using:
- Amazon Athena for SQL queries
- Jupyter Notebooks for advanced analysis (see example notebook)
Audit Logs
View comprehensive audit logs for administrative actions:Available Filters
user_id: Filter by specific useraction_type: Filter by action type (pin, unpin, view_user, etc.)start_time: Start timestamp (epoch seconds)end_time: End timestamp (epoch seconds)
Audit Log Fields
Dashboard
The admin dashboard provides a visual overview of:- Chatbot and user usage aggregated by time period
- Cost sorting and comparison
- Bot analytics with trend visualization
- Satisfaction scores and feedback metrics
Important Notes
- Data Latency: Export from DynamoDB to S3 occurs hourly, so recent conversations may not appear immediately
- Unused Resources: Bots/users with no activity during the specified period are excluded from usage reports
- Multi-Environment: For named environments, remember to adjust database and table names in Athena queries
- Cost Attribution: Costs are attributed based on the model used and token consumption
Best Practices
- Regular Monitoring: Review cost summaries weekly to identify trends
- Optimize High-Cost Bots: Investigate expensive bots and optimize their prompts or model selection
- User Training: Identify users with high costs and provide guidance on efficient usage
- Feedback Analysis: Regularly review user feedback to improve bot quality
- Retention Policies: Define data retention policies for conversation exports
- Alert Configuration: Set up CloudWatch alarms for unusual cost patterns