Migration Skills
Teach your agent to move tracing from another observability platform to confident-trace in Python and TypeScript.
Overview
The migration Agent Skills teach your coding agent how to move an AI application's traces from another observability platform to Confident AI's OpenTelemetry endpoint. The agent finds every integration with the old platform in your codebase, works out which SDK version each service runs, and then takes one of two routes:
- Switch to
confident-trace(the default): replace the old SDK with the Python or TypeScriptconfident-traceSDK, rewriting its calls toinit(),span,update_trace(), andupdate_span()while keeping the same span names, nesting, users, sessions, tags, and metadata. - Export over OpenTelemetry: when the old SDK is built on OpenTelemetry and you want to keep it for now, add an OTLP exporter that sends the spans it already creates to Confident AI, without rewriting your instrumentation.
GitHub Repository
View the source code, report issues, and find the latest releases.
There's one skill per platform you're migrating from:
| Migrating from | Skill | Covers |
|---|---|---|
| Langfuse | confident-migrate-langfuse | Langfuse SDK v1, v2, v3, and v4 (TypeScript v4 and v5), Python and TypeScript, with either route where the version allows it |
Installation
Works with Cursor, Claude Code, Codex, Windsurf, OpenCode, and any other Skills-compatible assistant. Install the skill for the platform you're leaving:
npx skills add confident-ai/confident-skills --skill "confident-migrate-langfuse"The Confident Trace plugin bundles confident-tracing, confident-otel, and every migration skill:
/plugin marketplace add confident-ai/confident-skills
/plugin install confident-trace@confident-skills
/reload-pluginsCopy the skill folder into your agent's skills directory:
git clone https://github.com/confident-ai/confident-skills
cp -r confident-skills/plugins/confident-trace/skills/confident-migrate-langfuse .claude/skills/Prerequisites
- Python 3.10+ or Node.js 22+
- A project-scoped
CONFIDENT_API_KEYfor export to Confident AI
Langfuse
The confident-migrate-langfuse skill moves tracing from Langfuse to Confident AI. What changes depends on the Langfuse SDK version in your app, not the Langfuse server version, and every version can move straight to confident-trace, so there's no need to upgrade Langfuse first.
When It Triggers
Migrate this app from Langfuse to Confident AI.
Replace @observe and langfuse_context with confident-trace.
Swap our observeOpenAI wrapper and Langfuse CallbackHandler for confident-trace.
Keep our Langfuse instrumentation but also export the spans to Confident AI.Choosing a Method
The skill defaults to a full switch and only keeps Langfuse in place when you ask it to:
| Method | What happens | Available |
|---|---|---|
| Full switch (default) | The Langfuse SDK is replaced with confident-trace, which exports to Confident AI's OTel endpoint | Every version, Python and TypeScript |
| OpenTelemetry exporter | Langfuse instrumentation stays, and an OTLP exporter pointed at Confident AI also receives its spans | Python v3 and v4, TypeScript v4 and v5 |
Langfuse v1, v2, and TypeScript v3 send traces through Langfuse's own ingestion API rather than OpenTelemetry, so they only support the full switch.
For the OpenTelemetry method, the agent adds a span processor to the tracer provider Langfuse already uses, next to Langfuse's own export:
import os
from langfuse import get_client
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace.export import BatchSpanProcessor
langfuse = get_client()
trace.get_tracer_provider().add_span_processor(
BatchSpanProcessor(
OTLPSpanExporter(
endpoint="https://otel.confident-ai.com/v1/traces",
headers={"x-confident-api-key": os.environ["CONFIDENT_API_KEY"]},
)
)
)import { NodeSDK } from "@opentelemetry/sdk-node";
import { LangfuseSpanProcessor } from "@langfuse/otel";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto";
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-base";
const sdk = new NodeSDK({
spanProcessors: [
new LangfuseSpanProcessor(),
new BatchSpanProcessor(
new OTLPTraceExporter({
url: "https://otel.confident-ai.com/v1/traces",
headers: { "x-confident-api-key": process.env.CONFIDENT_API_KEY! },
}),
),
],
});
sdk.start();When you're ready to cut over in Python, Langfuse(blocked_instrumentation_scopes=["langfuse-sdk"]) stops the export to Langfuse while spans keep reaching Confident AI.
The agent explains this method's limits before using it:
- The Langfuse keys must stay set in Python, because Langfuse creates no spans without them.
- Langfuse's sampling and masking also shape what Confident AI receives in Python. In TypeScript, masking belongs to
LangfuseSpanProcessor, so data masked for Langfuse reaches Confident AI unmasked. - Every span on the provider is exported, including HTTP client and database spans from other instrumentations.
- Scores, prompts, and datasets aren't sent over OpenTelemetry.
What Changes in Your Codebase
Find every Langfuse integration
The agent searches for
langfuseand@langfuse/*imports,@observe,langfuse_context,get_client(),langfuse.trace(),trace.generation(),langfuse.openai,observeOpenAI,LangfuseMedia,LangfuseSpanProcessor, the Langfuse LangChainCallbackHandler, andLANGFUSE_*environment variables.Prompt Migrate this app from Langfuse to Confident AI.Confirm the SDK version
It runs
pip show langfuse,npm ls langfuse, ornpm ls @langfuse/tracingfor each service, since Python and TypeScript services in one repository can be on different versions, and stops to ask if the version is unclear.Rewrite the tracing code
For the full switch, following the reference for that version, the agent calls
init()once, swaps provider wrappers for the plain client, renames@observeto@span, and moves trace and span fields ontoupdate_trace()andupdate_span(). A Langfuse session ID becomes a thread ID.Python example (Langfuse v3)
Before from langfuse import get_client, observe langfuse = get_client() @observe() def support_chat(question: str) -> str: langfuse.update_current_trace( name="support-chat", user_id="user-7", session_id="session-42", tags=["support"], ) return answer(question)After from confident_trace import span, update_trace @span def support_chat(question: str) -> str: update_trace( name="support-chat", user_id="user-7", thread_id="session-42", tags=["support"], ) return answer(question)Generations around model calls that automatic instrumentation already covers are dropped; the agent keeps an LLM span only for model calls it doesn't cover.
Point the export at Confident AI
Both routes send to Confident AI's OTLP/HTTP traces endpoint, and the agent swaps the Langfuse settings for Confident AI's:
Langfuse Confident AI LANGFUSE_PUBLIC_KEY,LANGFUSE_SECRET_KEYCONFIDENT_API_KEYLANGFUSE_HOST,LANGFUSE_BASEURL,LANGFUSE_BASE_URLNothing for US projects, CONFIDENT_OTEL_ENDPOINTfor EU or self-hostedUS projects export to
https://otel.confident-ai.com/v1/tracesby default. EU projects setCONFIDENT_OTEL_ENDPOINTtohttps://eu.otel.confident-ai.com/v1/traces, and self-hosted deployments set it to their own OTLP/HTTP traces URL. To compare both platforms during the switch, pointCONFIDENT_OTEL_ENDPOINTat an OpenTelemetry Collector that sends to both.Leave prompt, dataset, and score calls alone
Calls like
get_prompt(),create_dataset(),create_dataset_item(), andscore()use the Langfuse API, not tracing. The agent doesn't delete or rewrite them; it lists them for you and keeps thelangfusepackage installed if any remain.Verify and report
The agent runs the app once and confirms the trace appears in your project's Observatory, then summarizes every change and what's left for you: setting
CONFIDENT_API_KEY, an EU or self-hosted endpoint, any model calls it couldn't map, and the Langfuse API calls it left in place.export CONFIDENT_API_KEY="confident_us_proj_..." python main.py
To do the same migration by hand, follow the guide for your SDK version: v1, v2, v3, or v4.
FAQs
Do I need to upgrade my old SDK before migrating?
No. Each skill has a reference per SDK version of the platform you're
leaving, and every version can move straight to confident-trace.
What happens to my prompts, datasets, and scores on the old platform?
The skills only migrate tracing. Calls to the old platform's prompt, dataset, and scoring APIs are left in place and listed for you. Confident AI can import datasets, prompts, and historical scores on a migration call.
Can I keep my old instrumentation and still send traces to Confident AI?
Yes, when the old SDK is built on OpenTelemetry. The skill adds an OTLP exporter pointed at Confident AI's endpoint, so the spans your app already creates reach Confident AI too, and you can stop the old export whenever you're ready. For Langfuse, that's Python v3 and v4 and TypeScript v4 and v5.
Will it add tracing that wasn't there before?
No. It's a one-to-one migration. For new instrumentation, such as a
framework integration the app didn't use before, use the
confident-tracing skill.
Next Steps
Confident Tracing Skill
Add instrumentation beyond what your old platform covered.
LLM Tracing Quickstart
See the confident-trace setup the migration lands on.
Last updated on