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:

  1. Define a custom property, such as conversation_id, for your long-running conversation.

  2. Enrich your traces with this property dynamically as the conversation progresses.

  3. 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:

  1. Install the Traceloop SDK in your application.

  2. Use Association Properties to track long-running conversations if needed.

  3. Start tracing your AI applications without worrying about separate OpenTelemetry instrumentation.

For more information on installation and setup, please refer to our main documentation.