langfuse-hello-world

Featured

Create a minimal working Langfuse trace example. Use when starting a new Langfuse integration, testing your setup, or learning basic Langfuse tracing patterns. Trigger with phrases like "langfuse hello world", "langfuse example", "langfuse quick start", "first langfuse trace", "simple langfuse code".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Langfuse Hello World ## Overview Create your first Langfuse trace with real SDK calls. Demonstrates the trace/span/generation hierarchy, the `observe` wrapper, and the OpenAI drop-in integration. ## Prerequisites - Completed `langfuse-install-auth` setup - Valid API credentials in environment variables - OpenAI API key (for the OpenAI integration example) ## Instructions ### Step 1: Hello World with v4+ Modular SDK ```typescript // hello-langfuse.ts import { startActiveObservation, observe, updateActiveObservation } from "@langfuse/tracing"; import { LangfuseSpanProcessor } from "@langfuse/otel"; import { NodeSDK } from "@opentelemetry/sdk-node"; // Register OpenTelemetry processor (once at startup) const sdk = new NodeSDK({ spanProcessors: [new LangfuseSpanProcessor()], }); sdk.start(); async function main() { // Create a top-level trace with startActiveObservation await startActiveObservation("hello-world", async (span) => { span.update({ input: { message: "Hello, Langfuse!" }, metadata: { source: "hello-world-example" }, }); // Nested span -- automatically linked to parent await startActiveObservation("process-input", async (child) => { child.update({ input: { text: "processing..." } }); await new Promise((r) => setTimeout(r, 100)); child.update({ output: { result: "done" } }); }); // Nested generation (LLM call tracking) await startActiveObservation( { name: "llm-response", asType: "generatio...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category