| name | langfuse-core-workflow-a |
| description | Execute Langfuse primary workflow: Tracing LLM calls and spans.
Use when implementing LLM tracing, building traced AI features,
or adding observability to existing LLM applications.
Trigger with phrases like "langfuse tracing", "trace LLM calls",
"add langfuse to openai", "langfuse spans", "track llm requests".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Grep |
| version | 1.12.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","langfuse","observability","llm","workflow"] |
| compatibility | Designed for Claude Code |
Langfuse Core Workflow A: Tracing LLM Calls
Overview
End-to-end tracing of LLM calls, chains, and agents. Covers the OpenAI drop-in wrapper, manual tracing with startActiveObservation, RAG pipeline instrumentation, streaming response tracking, and LangChain integration.
Prerequisites
- Completed
langfuse-install-auth setup
- OpenAI SDK installed (
npm install openai)
- For v4+:
@langfuse/openai, @langfuse/tracing, @langfuse/otel, @opentelemetry/sdk-node
Instructions
Step 1: OpenAI Drop-In Wrapper (Zero-Code Tracing)
import OpenAI from "openai";
import { observeOpenAI } from "@langfuse/openai";
const openai = observeOpenAI(new OpenAI());
const response = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "What is Langfuse?" },
],
});
const res = await observeOpenAI(new OpenAI(), {
: ,
: { : },
: ,
: ,
: [, ],
})...({
: ,
: [{ : , : }],
});