Basic Features
User Tracking
6 min
the users view provides an overview of all users it also offers an in depth look into individual users it's easy to map data in abv to individual users just pass a unique identifier as the userid when you create a trace this can be a username, email, or any other unique identifier the userid is optional, but using it helps you get more from abv see the integration docs to learn more implementation with python sdk when using the @observe() decorator from abvdev import observe, get client abv = get client() @observe() def process user request(user query) \# add user id to the current trace abv update current trace(user id="user 12345") \# your processing logic return result when creating spans directly from abvdev import get client abv = get client() \# you can set the user id when creating the root span via update trace with abv start as current span( name="process user request" ) as root span \# add user id to the trace root span update trace(user id="user 12345") \# all spans in this trace will be associated with this user with root span start as current generation( name="generate response", model="gpt 4o" ) as gen \# generate response pass you can also update the user id of the current trace without a direct reference to a span with abv start as current span(name="handle user interaction") \# add user id to the current trace abv update current trace(user id="user 12345") implementation with js/ts sdk when using the context manager import { startactiveobservation, startobservation, updateactivetrace, } from "@abvdev/tracing"; await startactiveobservation("context manager", async (span) => { span update({ input { query "what is the capital of france?" }, }); updateactivetrace({ userid "user 123", }); }); when using the observe wrapper import { observe, updateactivetrace } from "@abvdev/tracing"; // an existing function async function fetchdata(source string) { updateactivetrace({ userid "user 123", }); // logic to fetch data return { data `some data from ${source}` }; } // wrap the function to trace it const tracedfetchdata = observe(fetchdata, { name "observe wrapper", }); const result = await tracedfetchdata("api"); when creating spans manually import { startobservation } from "@abvdev/tracing"; const span = startobservation("manual observation", { input { query "what is the capital of france?" }, }); span updatetrace({ userid "user 123", }); span update({ output "paris" }) end(); see typescript sdk overview docid\ j4sdnlmdmnfmk99ootgn7 for more details view all users the user list provides an overview of all users that have been tracked by abv it makes it simple to segment by overall token usage, number of traces, and user feedback individual user view the individual user view provides an in depth look into a single user explore aggregated metrics or view all traces and feedback for a user you can deep link to this view via the following url format https //\<hostname>/project/{projectid}/users/{userid}