Skip to main content

Trace Types

interface TraceData {
  traceId: string;
  parentTraceId?: string;
  projectId: string;
  executionId?: string;
  threadId?: string;
  type: TraceType;
  operation: string;
  input: any;
  output?: any;
  status: 'success' | 'error' | 'timeout' | 'cancelled';
  error?: string;
  startTime: Date;
  endTime?: Date;
  duration: number;
  metadata: TraceMetadata;
  costs?: TraceCosts;
}

type TraceType =
  | 'agent_execution'
  | 'workflow_execution'
  | 'workflow_step'
  | 'tool_call'
  | 'connector_call'
  | 'vector_search'
  | 'memory_operation'
  | 'llm_call'
  | 'streaming_session';

interface TraceCosts {
  tokens?: {
    input: number;
    output: number;
    total: number;
  };
  costs?: {
    inputCost: number;
    outputCost: number;
    totalCost: number;
    currency: string;
  };
}

Next Steps