Index of every page on this site: llms.txt
All skills
langfuse avatar

/migrate-to-langfuse

@f0bcb13 official
by langfuselangfuse/skills346 stars
46
Run it yourself

Migrate to Langfuse from another LLM observability/evals platform (LangSmith, Arize AX, Phoenix, Braintrust, Helicone, Promptfoo, ...). A one-off vendor switch: live tracing cutover plus transfer of historical traces, datasets, prompts, and evaluators. Not for anything Langfuse-to-Langfuse — SDK or version upgrades, project/region moves, self-hosted to Cloud — and not for moving in-code prompts into Langfuse; the main langfuse skill covers those.

Use this Skill: https://skilld.dev/gh/langfuse/skills/migrate-to-langfuse

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesreingest-history.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Reingest historical data into Langfuse

Build a one-off script: extract from the source, transform to the Langfuse observation model, reingest. Extract using the source vendor's documented export mechanism (SDK export client or documented API, as named in the matching migration guide on langfuse.com) — never guess REST endpoints or hostnames. If an export call fails with 404/405, stop and re-read the vendor guide instead of trying endpoint variants. Adapt the working implementation in the project-to-project migration cookbook — its OTLP reingestion, retry, and ID-mapping code applies to any source.

Transform target

Fetch migrate custom ingestion to v4 for the current span format and attributes. Non-negotiables:

  • POST OTLP JSON to /api/public/otel/v1/traces, building the payload as plain JSON — the only path that preserves original start_time/end_time. Do not create the spans through an OTel or Langfuse SDK tracer: tracers assign new timestamps and random trace/span IDs, and offer no way to set either.
  • Destination IDs must be OTel-shaped: 32-hex-char trace IDs, 16-hex-char span IDs. Derive them deterministically from source IDs (e.g. a sha256 prefix) so every source record maps to one predictable destination ID for reconciliation and resume logic. Deterministic IDs do not make re-sends safe: Langfuse v4 does not reliably deduplicate same-ID re-ingests, a re-sent span can create a duplicate observation and inflate counts and cost (see the migration guide above). Idempotency comes from not re-sending: record each successfully sent source ID in a local state file and skip recorded IDs on every re-run. Verify after the sample run that the destination trace IDs match the computed ones. If they do not, the spans went through a tracer.
  • Map source spans to Langfuse observation types (generation, tool, agent, span) and set gen_ai.usage.* and model attributes so token usage and cost tracking work. Put user, session, tags, and metadata in the documented langfuse.* trace attributes; overall input/output goes on the root observation.

Migration order

Dependencies dictate order: score configs → custom model definitions → prompts (all versions, in version order, then labels) → observations (traces) → scores → datasets (items, then run items linked to migrated traces). Skip whatever the user excluded in the interview.

Not migratable via API (tell the user; do not attempt): LLM-as-a-Judge evaluator configurations, custom dashboards, users/RBAC, project settings. Recreate evaluators in the destination instead, and re-run experiments rather than importing their scores.

Execution protocol

  1. Cutoff filter from the interview goes into the source extraction query, not post-hoc filtering. If the live cutover already happened, also bound the window at the cutover time — traces after it are already arriving in the destination, and reingesting them duplicates data.
  2. Sample run first: ~10 traces spanning the date range. Print direct links to the destination traces and stop until the user confirms they look correct — hierarchy, timestamps, token usage and cost, scores attached.
  3. Full run: paginate the source, batch the ingestion, print progress (page X — N traces migrated, M failed), and collect failures with their source IDs into a retry file instead of aborting. Resume from the state file: skip every source ID already recorded as sent, including the sample run — re-sending creates duplicate observations and is billed again.
  4. Reconcile: compare source vs destination counts per data type and report the table. Duplicate observations in the destination mean the same ID was sent twice - a migration bug to fix in the state-file skip, not a transient artifact that clears itself. Remind the user that reingested history is billed as new ingestion.

Historical cost may differ from what the source displayed: the destination recomputes cost from current model prices unless the source's actual cost is carried in the documented cost attributes.

Verify credentials by presence only ([ -n "$LANGFUSE_SECRET_KEY" ]); never print secret values.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    A specialized migration tool for moving data from various LLM observability platforms to Langfuse. The skill includes strong security guardrails to prevent credential theft and requires user confirmation before any code execution or data transfer.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: MEDIUM · 1 issue

Signed by skilld at f0bcb13. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 2 months ago
What it can do
Network Runs commands
All 2 allowed tools
WebFetch(domain:langfuse.com)Bash(curl *langfuse.com/*)

README badge

README badge for langfuse/skills/migrate-to-langfuse