Users
Tracking user info in your traces for observability
Overview
You can track user interactions with your LLM app by setting the user_id in a trace. This allows you to track things such as how much tokens each user is costing you, who interacted with your LLM app the most, etc.
Set Users At Runtime
Python
TypeScript
You can use the update_current_trace function to set the user_id within traces:
main.py
The user_id can be any string, including the actual IDs of customers in your own database, or even their email addresses. Everything will be viewable and searched in the UI.