Track LLM errors in your endpoint
Learn how to track complete LLM flows in the LLM logging guide.
Track Errors from Tool Calls
Explore more on tool call tracking in the Tool calls logging guide.

Learn how to effectively track and log errors from LLM results and Tool calls in your AI application traces. Improve performance and reliability by capturing error details including messages, types, and error codes for better debugging and monitoring.
// Create generation object
const generation = trace.generation({
id: "generation-id",
name: "customer-support--gather-information",
// Additional fields
});
// Track error
generation.error({
message: "Rate limit exceeded. Please try again later.",
type: "RateLimitError",
code: "429",
});
const traceToolCall = trace.toolCall({
id: "tool-call-id",
name: "tool-call-name",
});
traceToolCall.error({
message: "Service is currently unavailable. Please try again later.",
type: "ServiceUnavailableError",
code: "503",
});

Was this page helpful?