user_id, chat_id, or anything else that is tied to the flow that triggered the trace.
OpenLLMetry allows you to easily mark traces with these IDs so you can track them in the UI.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
How to associate traces with entities in your own application
user_id, chat_id, or anything else that is tied to the flow that triggered the trace.
OpenLLMetry allows you to easily mark traces with these IDs so you can track them in the UI.
org_id, team_id, whatever you want. The only requirement is that
the key and the value are strings.from traceloop.sdk import Traceloop
Traceloop.set_association_properties({ "user_id": "user12345", "chat_id": "chat12345" })
// Option 1 (for class methods only) - set association properties within a workflow, task, agent or tool
class MyClass {
@traceloop.workflow({ associationProperties: { userId: "user123" })
myMethod() {
// Your code here
}
}
// Option 2 - set association properties within a workflow, task, agent or tool
traceloop.withWorkflow(
{
name: "workflow_name",
associationProperties: { userId: "user12345", chatId: "chat12345" },
},
() => {
// Your code here
// (function can be made async if needed)
}
);
// Option 3 - set association properties directly
traceloop.withAssociationProperties(
{
userId: "user12345",
chatId: "chat12345",
},
() => {
// Your code here
// (can be async or sync)
}
);
Was this page helpful?
