Skip to main content

Overview

Respan parameters allow you to add contextual information to your traces, enabling better analytics, user tracking, and workflow understanding.

Available Respan Parameters

ParameterTypeDescriptionExample
customer_identifierstringUnique customer ID"user_123"
customer_namestringCustomer display name"John Doe"
customer_emailstringCustomer email address"[email protected]"
metadataobjectCustom key-value pairs{"priority": "high"}
custom_identifierstringCustom operation ID"ticket_789"
thread_identifierstringConversation thread ID"thread_abc"
For the complete list of available parameters, see the Respan API reference.

Compatibility

IntegrationSupportNotes
Respan NativeFull support for all Respan params
OpenAI Agents SDKNot supported yet
Vercel AI SDKNot supported yet

Integration

Setup

Make sure you have everything ready before you start.

Implementation

Basic Respan params usage

from respan_tracing.decorators import workflow, task
from respan_tracing.contexts.span import respan_span_attributes
from openai import OpenAI

client = OpenAI()

@task(name="simple_task")
def simple_task():
    with respan_span_attributes(
        respan_params={
            "customer_params": {
                "customer_identifier": "user_123",
            },
            "metadata": {"task_type": "simple"}
        }
    ):
        response = client.chat.completions.create(
            model="gpt-3.5-turbo",
            messages=[{"role": "user", "content": "Hello!"}]
        )
        return response.choices[0].message.content
This workflow creates a trace hierarchy with Respan params:
  • Parent workflow: customer_support_workflow with thread and session metadata
  • Individual tasks: user_query_processing, response_formatting with customer and operation metadata
  • Complete parameter tracking: customer info, custom identifiers, and contextual metadata
  • Enhanced analytics: filtering by customer, priority, department, and session

How to see this in the platform

Once you’ve implemented Respan params in your traces, you can view and filter by them in the Respan platform:

Accessing enriched traces

  1. Navigate to the Traces page in your Respan dashboard
  2. You’ll see traces with additional metadata and customer information

Understanding the enhanced trace view

  • Customer tracking: Filter traces by customer identifier, name, or email
  • Custom metadata: Use metadata fields for advanced filtering and analytics
  • Thread grouping: View related conversations using thread identifiers
  • Custom identifiers: Track specific operations or tickets

Example trace with Respan params

Traces with Respan parameters showing customer and metadata information
The enhanced trace view shows:
  • Customer information in the trace details
  • Custom metadata for filtering and analysis
  • Thread and session grouping
  • Performance metrics with contextual data