Adding SessionID and UserID as attributes to Spans for Tracing
session ID
attribute. This is particularly useful when developing or debugging a chatbot application, as it allows you to view collections of messages or traces that belong to a series of interactions between a human and the AI. By incorporating session.id
and user.id
as span attributes, you can:
session.id
and/or user.id
from an application allows for grouping and further filtering of interactions.session.id
or user.id
to identify the best and worst performing sessions and users.with
block in the example below) will include the corresponding session.id
or user.id
as a span attribute. Both session.id
and user.id
must be non-empty strings.
When setting up your instrumentation, you can pass the sessionID
attribute as demonstrated below.
using_session
using_user