Skip to main content

Overview

Respan Tracing captures telemetry for your LLM applications. It records workflows and tasks, tracks timings and errors, and sends traces to Respan so you can visualize and debug runs.

Core Concepts

  • Workflows represent an end-to-end agent run
  • Tasks are operations within a workflow (LLM calls, tools, steps)
  • Traces are sent to Respan for visualization and analysis

Components

  • Decorators: workflow, task, agent, tool
  • Client: RespanTelemetry and get_client()
  • Contexts: respan_span_attributes()
  • Instrumentation: Instruments enum and configuration

Example

import os
from respan_tracing import RespanTelemetry
from respan_tracing.decorators import workflow, task

os.environ["RESPAN_API_KEY"] = "your-api-key"
os.environ["RESPAN_BASE_URL"] = "https://api.respan.ai/api"

k_tl = RespanTelemetry()

@workflow(name="my_workflow")
def my_workflow():
    @task(name="my_task")
    def my_task():
        return "done"
    return my_task()

result = my_workflow()
print(result)

Next Steps