How to trace long-running conversations with Traceloop
Last updated: December 13, 2024
Traceloop is an open-source tool that allows you to trace and monitor your AI applications. This article explains how to handle tracing for long-running, asynchronous conversations that span multiple days.
Using Association Properties for Long-Running Conversations
For tracing long-running sessions or conversations, we recommend using "Association Properties". This feature allows you to dynamically enrich traces with custom identifiers, such as a conversation ID.
Here's how you can use Association Properties:
Define a custom property, such as
conversation_id, for your long-running conversation.Enrich your traces with this property dynamically as the conversation progresses.
Later, you can filter your traces using this property to view all interactions within a specific conversation.
For more detailed information on using Association Properties, refer to our documentation: Association Properties Documentation
Traceloop and OpenTelemetry
A common question is whether OpenTelemetry (OTEL) instrumentation is required to use Traceloop. Here's what you need to know:
Traceloop uses OpenTelemetry internally in its SDK.
If your application doesn't already use OpenTelemetry, you don't need to instrument it separately.
Simply installing the Traceloop SDK is sufficient to start using the tool in your application.
Getting Started
To begin using Traceloop in your project:
Install the Traceloop SDK in your application.
Use Association Properties to track long-running conversations if needed.
Start tracing your AI applications without worrying about separate OpenTelemetry instrumentation.
For more information on installation and setup, please refer to our main documentation.