Agent skill · software engineering · jeremylongshore
langfuse-core-workflow-a
Execute Langfuse primary workflow: Tracing LLM calls and spans.
Why this skill is useful
Adds executable scripts for tracing LLM calls and spans that enhance observability in AI applications.
What it needs
Requires npm installed locally. Requires openai account access. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
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) Step 2: Manual Tracing -- RAG Pipeline (v4+ SDK) Step 3: Manual Tracing -- RAG Pipeline (v3 Legacy) Step 4: Streaming Response Tracking Step 5: Anthropic Claude Tracing (Manual) Step 6: LangChain Integration (Python) Error Handling Issue Cause Solution ------- ------- ---------- Missing generations OpenAI wrapper not applied Use observeOpenAI() from @langfuse/openai Orphaned spans Missing end or callback finish Use startActiveObservation (auto-ends) or .end() in finally No token usage on stream Stream usage not requested Add streamoptions: { includeusage: true } Flat trace (no nesting) Missing OTel context Ensure NodeSDK is started with LangfuseSpanProcessor Output Produce a trace with a named root observation, nested spans or generations, model and usage metadata, and a final output value. Record the trace identifier or dashboard URL so the implementation can be verified without exposing prompt contents. Examples After wrapping a single OpenAI client with observeOpenAI, make one test request and verify that its generation has model, latency, input/output, and token usage. For a RAG path, verify that embed-query, vector-search, and generate-answer appear under the same root trace. Resources OpenAI JS Integration TypeScript Instrumentation LangChain Integration Observation Types Next Steps For evaluation and scoring workflows, see langfuse-core-workflow-b.
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/langfuse-core-workflow-a