Agent skill

Langfuse Upgrade Migration

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Upgrade Langfuse SDK versions and migrate between API changes.

MITAuto-check passedAI & LLM Engineering

Install Langfuse Upgrade Migration

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-upgrade-migration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace langfuse-upgrade-migration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/langfuse-upgrade-migration .claude/skills/langfuse-upgrade-migration && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
langfuse-upgrade-migration
GitHub stars
2.8k
Token cost
~2.1k tokens
SKILL.md length
383 words
Files
2 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Upgrade Langfuse SDK versions and migrate between API changes.

  • Works in 5 steps: Check Current Version and Plan → v3 to v4 Migration (TypeScript) → Python SDK Migration (v2 to v3) → …
  • Upgrading Langfuse SDK
  • SKILL.md covers Current State, Overview, Prerequisites and Version Roadmap, plus 6 more sections
  • Calls npm, pip and node; needs LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY

What it does

Langfuse Upgrade Migration is an agent skill from jeremylongshore/tons-of-skills-marketplace. Upgrade Langfuse SDK versions and migrate between API changes. Use when upgrading Langfuse SDK, handling breaking changes, or migrating between Langfuse versions. Trigger with phrases like "upgrade langfuse", "langfuse migration", "update langfuse SDK", "langfuse breaking changes", "langfuse version".

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/implementation.md`). Compatibility notes: Designed for Claude Code

It sits in AI & LLM Engineering, covering LLM observability. It works with Langfuse, OpenTelemetry and OpenAI. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Upgrading Langfuse SDK
  • Handling breaking changes
  • Migrating between Langfuse versions
  • With phrases like upgrade langfuse

Example prompts

  • “upgrade langfuse”
  • “langfuse migration”
  • “update langfuse SDK”
  • “/langfuse-upgrade-migration”

Requirements

  • Python 3
  • Node.js
  • A credential in LANGFUSE_PUBLIC_KEY
  • A credential in LANGFUSE_SECRET_KEY
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(npm:*), Bash(pip:*)

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Check Current Version and Plan
  2. v3 to v4 Migration (TypeScript)
  3. Python SDK Migration (v2 to v3)
  4. Run Tests and Verify
  5. Remove Old Package

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(npm:*)
    • Bash(pip:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • pip
    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • langfuse.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • LANGFUSE_PUBLIC_KEY
    • LANGFUSE_SECRET_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Langfuse Upgrade Migration loads about 2.1k tokens when it runs, and up to ~3k if it reads all its reference files. Until then it costs about 82 tokens; SKILL.md has 383 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~82
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 383 words, ~2,067 tokens.

Download SKILL.mdSave it as .claude/skills/langfuse-upgrade-migration/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
langfuse-upgrade-migration
description
Upgrade Langfuse SDK versions and migrate between API changes. Use when upgrading Langfuse SDK, handling breaking changes, or migrating between Langfuse versions. Trigger with phrases like "upgrade langfuse", "langfuse migration", "update langfuse SDK", "langfuse breaking changes", "langfuse version".
allowed-tools
Read, Write, Edit, Bash(npm:*), Bash(pip:*)
compatibility
Designed for Claude Code
version
1.17.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, langfuse, api, migration

Langfuse Upgrade & Migration

Current State

!npm list langfuse @langfuse/client @langfuse/tracing @langfuse/otel 2>/dev/null | head -10 || echo 'No langfuse packages found' !pip show langfuse 2>/dev/null | grep -E "Name|Version" || echo 'Python langfuse not installed'

Overview

Step-by-step guide for upgrading the Langfuse SDK across major versions. Covers v3 to v4 (OTel rewrite), v4 to v5, breaking changes, and automated codemods.

Prerequisites

  • Existing Langfuse integration
  • Test suite covering traced operations
  • Git branch for the upgrade

Version Roadmap

SDKPackageArchitectureStatus
v3langfuse (single)Custom, Langfuse classLegacy
v4@langfuse/client, @langfuse/tracing, @langfuse/otelOpenTelemetry-basedStable
v5@langfuse/client, @langfuse/tracing, @langfuse/otelOpenTelemetry + improvementsLatest

Instructions

Step 1: Check Current Version and Plan
bash
set -euo pipefail
# Check what you have
npm list langfuse @langfuse/client @langfuse/tracing 2>/dev/null

# Check latest available
npm info @langfuse/client version
npm info @langfuse/tracing version
npm info langfuse version

# Python
pip show langfuse 2>/dev/null | grep Version
pip index versions langfuse 2>/dev/null | head -3
Step 2: v3 to v4 Migration (TypeScript)

This is the biggest migration -- v4 rewrites tracing on OpenTelemetry.

2a. Install new packages:

bash
set -euo pipefail
# Install v4+ packages
npm install @langfuse/client @langfuse/tracing @langfuse/otel @opentelemetry/sdk-node

# Keep langfuse v3 temporarily for comparison
# Remove after migration: npm uninstall langfuse

2b. Update initialization:

typescript
// BEFORE (v3):
import { Langfuse } from "langfuse";
const langfuse = new Langfuse({
  publicKey: process.env.LANGFUSE_PUBLIC_KEY,
  secretKey: process.env.LANGFUSE_SECRET_KEY,
  baseUrl: process.env.LANGFUSE_HOST,
});

// AFTER (v4+):
import { LangfuseClient } from "@langfuse/client";
import { LangfuseSpanProcessor } from "@langfuse/otel";
import { NodeSDK } from "@opentelemetry/sdk-node";

// OTel setup (once at entry point)
const sdk = new NodeSDK({
  spanProcessors: [new LangfuseSpanProcessor()],
});
sdk.start();

// Client for prompts, datasets, scores
const langfuse = new LangfuseClient();

2c. Update tracing calls:

typescript
// BEFORE (v3): Manual trace/span/generation
const trace = langfuse.trace({ name: "my-op", input: data });
const span = trace.span({ name: "step-1", input: data });
await doWork();
span.end({ output: result });
const gen = trace.generation({ name: "llm", model: "gpt-4o" });
gen.end({ output: response, usage: { promptTokens: 10 } });
await langfuse.flushAsync();

// AFTER (v4+): startActiveObservation with auto-nesting
import { startActiveObservation, updateActiveObservation } from "@langfuse/tracing";

await startActiveObservation("my-op", async () => {
  updateActiveObservation({ input: data });

  await startActiveObservation("step-1", async () => {
    updateActiveObservation({ input: data });
    const result = await doWork();
    updateActiveObservation({ output: result });
  });

  await startActiveObservation({ name: "llm", asType: "generation" }, async () => {
    updateActiveObservation({ model: "gpt-4o" });
    const response = await callLLM();
    updateActiveObservation({ output: response, usage: { promptTokens: 10 } });
  });
});

2d. Update OpenAI wrapper:

typescript
// BEFORE (v3):
import { observeOpenAI } from "langfuse";

// AFTER (v4+):
import { observeOpenAI } from "@langfuse/openai";
// npm install @langfuse/openai

2e. Update environment variable:

bash
# BEFORE: LANGFUSE_HOST or LANGFUSE_BASEURL
# AFTER:  LANGFUSE_BASE_URL (LANGFUSE_BASEURL still works in v4 but not v5)

2f. Update prompt management:

typescript
// BEFORE (v3):
const prompt = await langfuse.getPrompt("my-prompt", 2); // version as positional arg

// AFTER (v4+):
const prompt = await langfuse.prompt.get("my-prompt", {
  version: 2, // version in options object
  type: "text", // explicit type
});

2g. Update shutdown:

typescript
// BEFORE (v3):
await langfuse.shutdownAsync();

// AFTER (v4+):
await sdk.shutdown(); // Shuts down OTel SDK + flushes spans
Step 3: Python SDK Migration (v2 to v3)
python
# BEFORE (v2):
from langfuse import Langfuse
langfuse = Langfuse()

@langfuse.observe()
def my_function():
    pass

# AFTER (v3):
from langfuse.decorators import observe, langfuse_context

@observe()
def my_function():
    langfuse_context.update_current_observation(
        metadata={"key": "value"}
    )
Step 4: Run Tests and Verify
bash
set -euo pipefail
# Run existing test suite
npm test

# Verify traces appear in dashboard
node -e "
  const { startActiveObservation, updateActiveObservation } = require('@langfuse/tracing');
  startActiveObservation('upgrade-verify', async () => {
    updateActiveObservation({ input: { test: true }, output: { migrated: true } });
  }).then(() => console.log('Migration verified'));
"
Step 5: Remove Old Package
bash
set -euo pipefail
# After all tests pass
npm uninstall langfuse

# Verify no lingering imports
grep -rn "from ['\"]langfuse['\"]" src/ || echo "No old imports found"

Breaking Changes Quick Reference

Changev3v4+
Packagelangfuse@langfuse/client + @langfuse/tracing + @langfuse/otel
Client classLangfuseLangfuseClient
Base URL envLANGFUSE_HOSTLANGFUSE_BASE_URL
Tracinglangfuse.trace() / .span() / .generation()startActiveObservation() / observe()
Flushlangfuse.flushAsync()sdk.shutdown()
Prompt versiongetPrompt(name, version)prompt.get(name, { version })
OpenAIimport { observeOpenAI } from "langfuse"import { observeOpenAI } from "@langfuse/openai"
Show full SKILL.md (172 more words)Show less

Error Handling

ErrorCauseSolution
Cannot find module '@langfuse/tracing'Package not installednpm install @langfuse/tracing @langfuse/otel @opentelemetry/sdk-node
langfuse.trace is not a functionUsing v4 LangfuseClient for tracingUse startActiveObservation from @langfuse/tracing
Flat traces (no nesting)OTel SDK not startedRegister LangfuseSpanProcessor with NodeSDK
LANGFUSE_HOST ignoredv5 dropped legacy env varRename to LANGFUSE_BASE_URL

Output

Produce a versioned migration record containing the starting and target SDK versions, changed packages and imports, configuration changes, test evidence, and a rollback decision. The record must distinguish a successful build from a successful trace export in the intended Langfuse project.

Examples

Upgrade a staging service by installing the v4+ tracing packages beside the legacy client, migrating one request path to startActiveObservation, and verifying parent/child nesting in the staging project. Once the comparison is clean, remove the old package and imports in a separate reviewable change; retain the prior deployable artifact until the production verification window has closed.

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/.curated/langfuse-upgrade-migration of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/implementation.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Langfuse Upgrade Migration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Langfuse Upgrade Migration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Langfuse Upgrade Migration this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2.1kAutomated safety check: PassMIT
Ag2 Telemetryag2ai/build-with-ag2252—~1.9kAutomated safety check: PassApache-2.0
Phoenix LLM ObservabilityOrchestra-Research/AI-Research-SKILLs13k2 repos~2.9kAutomated safety check: PassMIT
Agentsop Observability Setupagentsope/SkillAlchemy436—~4.4kAutomated safety check: PassMIT
Langfusedavila7/claude-code-templates33k5 repos~1.4kAutomated safety check: PassMIT
Phoenix Integration SnippetsArize-ai/phoenix12k—~1.4kAutomated safety check: PassApache-2.0

Similar skills

  • Ag2 Telemetry

    ag2ai/build-with-ag2

    Add OpenTelemetry traces to an AG2 beta Agent via TelemetryMiddleware (autogen.beta.middleware.builtin).

    252 GitHub stars~1.9k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed
  • Phoenix LLM Observability

    Orchestra-Research/AI-Research-SKILLs

    Sets up Arize Phoenix to trace, evaluate and monitor LLM applications, with instrumentation for OpenAI, LangChain and LlamaIndex and a self-hosted server.

    13k GitHub starsUsed in 2 repos~2.9k tokens
    AI & LLM EngineeringAuto-check passed
  • Agentsop Observability Setup

    agentsope/SkillAlchemy

    Enhancement-overlay skill — the DECISION + WIRING layer for LM observability that the single-backend skills [[langsmith]], [[phoenix]], [[mlflow]] do NOT cover.

    436 GitHub stars~4.4k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • Langfuse

    davila7/claude-code-templates

    Expert in Langfuse - the open-source LLM observability platform.

    33k GitHub starsUsed in 5 repos~1.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Generates onboarding code snippets for Phoenix tracing integrations and wires them into the project onboarding UI.

    12k GitHub stars~1.4k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Langfuse

    sickn33/agentic-awesome-skills

    Expert in Langfuse - the open-source LLM observability platform.

    47k GitHub starsUsed in 2 repos~1.4k tokens
    AI & LLM EngineeringAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Questions about Langfuse Upgrade Migration

What does Langfuse Upgrade Migration do?

Upgrade Langfuse SDK versions and migrate between API changes. Langfuse Upgrade Migration is an agent skill from jeremylongshore/tons-of-skills-marketplace. Upgrade Langfuse SDK versions and migrate between API changes.

When should I use Langfuse Upgrade Migration?

Langfuse Upgrade Migration fits situations like: upgrading Langfuse SDK; handling breaking changes; migrating between Langfuse versions; with phrases like upgrade langfuse.

How do I install Langfuse Upgrade Migration in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-upgrade-migration -a claude-code`. Or copy the skill folder (skills/.curated/langfuse-upgrade-migration in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/langfuse-upgrade-migration in your project. Claude Code loads it when a task matches its description.

How do I install Langfuse Upgrade Migration in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-upgrade-migration -a codex`. Or copy the skill folder (skills/.curated/langfuse-upgrade-migration in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/langfuse-upgrade-migration in your project. Codex loads it when a task matches its description.

Can I use Langfuse Upgrade Migration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-upgrade-migration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/langfuse-upgrade-migration, .gemini/skills/langfuse-upgrade-migration, .github/skills/langfuse-upgrade-migration and .opencode/skills/langfuse-upgrade-migration in your project.

What does Langfuse Upgrade Migration need to run?

Going by SKILL.md and its folder, Langfuse Upgrade Migration needs the command-line tools its instructions call (npm, pip and node) and credentials named LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY. Our summary lists: Python 3; Node.js; A credential in LANGFUSE_PUBLIC_KEY; A credential in LANGFUSE_SECRET_KEY. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npm:*), Bash(pip:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Langfuse Upgrade Migration access the network?

SKILL.md names 1 domain. As links in the text: langfuse.com. This is read from the text; nothing was executed.

Is Langfuse Upgrade Migration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Langfuse Upgrade Migration use?

Langfuse Upgrade Migration is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Langfuse Upgrade Migration use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 969 tokens, read only when the agent opens those files.

What are the alternatives to Langfuse Upgrade Migration?

Skills that share tags, products or a category with Langfuse Upgrade Migration: Ag2 Telemetry (ag2ai/build-with-ag2, 252 stars), Phoenix LLM Observability (Orchestra-Research/AI-Research-SKILLs, 13k stars), Agentsop Observability Setup (agentsope/SkillAlchemy, 436 stars) and Langfuse (davila7/claude-code-templates, 33k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Langfuse Upgrade Migration?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.