
Langfuse PR Previews
FreeEasily create disposable previews for PRs in Langfuse.
Free · Opens the source repo
What Langfuse PR Previews does
Langfuse PR Previews provides a streamlined way to generate disposable, full-stack environments for pull requests (PRs) in the Langfuse repository. When a same-repo PR is opened, it automatically builds a web and worker image, allowing developers to access a live preview at a unique URL. This feature is particularly useful for testing deployments, debugging issues, and seeding test data without the need for manual setup. The previews are designed to be temporary, with automatic teardown upon closing the PR, ensuring that resources are not wasted.
The access model consists of two independent gates: building and deploying. Any member with write access can trigger a build by opening a same-repo PR, but only authors on the deploy allowlist can access the live preview URL. This ensures that sensitive data is not exposed, as all previews use synthetic data only. Users can log in automatically as a shared demo user or opt for a standard sign-in flow to test authentication changes. The environment is pre-seeded with demo data, which can be further customized using the seed CLI.
Langfuse PR Previews is ideal for developers working on the Langfuse project who need to test changes in a controlled environment. It simplifies the process of reviewing and debugging code by providing immediate access to a live version of the application. However, it is important to note that this tool is not suitable for external or forked PRs, as these do not build or deploy previews. Additionally, users must have cluster access to utilize certain features, such as waking sleeping previews or seeding specific test data.
In summary, Langfuse PR Previews is a valuable tool for developers looking to enhance their workflow by providing quick access to disposable environments for testing and debugging. Its automatic setup and teardown process, along with the ability to customize test data, make it a practical choice for teams working within the Langfuse ecosystem.
When to use it
Use this skill when you need to create a temporary environment for testing changes in the Langfuse repository without the overhead of manual configuration.
When not to use it
This skill is not suitable for external or forked pull requests, as they do not support building or deploying previews.
What you can build with it
Testing New Features
Open a PR to test new features in a disposable environment without affecting the main application.
Debugging Issues
Use the preview to debug issues in a live environment, making it easier to identify and fix problems.
Seeding Test Data
Customize your preview with specific test data scenarios using the seed CLI for more effective testing.
How to install Langfuse PR Previews
View source1. Install with the skills CLI
npx skills add langfuse/langfuse/langfuse-previews --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by langfuseLangfuse PR Previews
Every same-repo PR on langfuse/langfuse can get a disposable, full-stack
Langfuse environment at https://pr-<N>.preview.langfuse.com. Opening the PR
builds a web + worker image; if your GitHub login is on the deploy allowlist,
Argo CD (run from the private langfuse/infrastructure repo) deploys it.
Pushing updates it; closing the PR tears it down.
⚠️ Synthetic data only. The login is shared and the URL is public — never put a real credential, API key, or customer data into a preview. Treat every preview as throwaway.
Access model (two independent gates)
- Build — any write-access member. Every same-repo PR is auto-labeled
previewon open and builds a web + worker image. The gate is write (push) access — opening a same-repo PR requires it. Fork PRs never build or deploy (a public-repo PR can't mint the cloud credential). - Deploy — a per-author allowlist. A preview only gets a live URL if the PR
author is on the deploy allowlist (the
authorselector in the Argo CD ApplicationSet,langfuse/infrastructure). Not on it? Your PR still builds, but the URL 404s — add yourself (see Getting access).
Using a preview
- Spin up — open a same-repo PR. It's auto-labeled and builds (~5 min); a
bot comment then posts the preview URL and login, a
Live preview:line is pinned at the top of the PR description (removed again on teardown), and a deployment in the shared GitHubPR Previewenvironment gives the PR a View deployment button. No manual step, no label to add. - Log in — previews sign you in automatically as the shared demo user; just
open the URL. To use the regular sign-in flow instead (e.g. to test auth
changes), open
/auth/sign-in?autoSignIn=falseand use the credentials in the bot's PR comment (the source of truth); signing out via the UI also lands on that opted-out form, so you stay signed out until you next open a protected page. The demo project's shared seed identity isdemo@langfuse.com/password, with API keyspk-lf-1234567890/sk-lf-1234567890— shared and synthetic, so never treat a preview as private. - Know where you are — every preview page shows a top strip linking back to the PR, with the author and when the preview content last changed.
- Update — push to the PR; it rebuilds and rolls to the new image (~5 min,
same URL, data preserved). A brief
ImagePullBackOffduring the rebuild is normal and self-heals. - Tear down — close the PR, or remove the
previewlabel; namespace, data, and DNS record are all deleted. Merging closes the PR, so it tears down too.
Good to know
- Off-hours sleep. Previews run Mon–Fri 08:00–24:00 Europe/Berlin; nights
and weekends they scale to zero and stay there (schedule-driven — a request
does not wake them). To use one off-hours, wake it (needs cluster access):
kubectl annotate ns langfuse-pr-<N> downscaler/force-uptime=true --overwrite— replicas return in ~60s, ready in ~3–5 min; undo later with the trailing--form (downscaler/force-uptime-) so it sleeps again on schedule. - Capacity. A limited number of previews run at once; if the cluster is full,
a new one's pods sit
Pendinguntil an old preview is closed. - Disposable data. Closing a PR destroys its database; reopening gives a fresh environment, not the old one.
- Forks can't preview. External / fork PRs never build or deploy.
Add or improve data in a preview
Previews start pre-seeded with the demo project and some synthetic traces. To
add the specific shape you're testing — a very deep trace, a huge session, bulk
traces for list performance, v4 events, malformed payloads — run the
deterministic seed CLI from your local checkout, pointed at the preview's
datastores over a port-forward. The CLI has no LLM/agent loop; you (or your
coding agent) pick the scenario — the seed-test-data skill maps "what I
need" → the exact command and flags.
Needs cluster access (see Getting access) and a working
local .env (your normal local-dev setup — it supplies everything except the
DB connection, which the commands below override).
NS=langfuse-pr-<N> # e.g. langfuse-pr-42
# 1. tunnel Postgres + ClickHouse to localhost (leave these running)
kubectl -n $NS port-forward svc/$NS-postgresql 5432:5432 &
CH=$(kubectl -n $NS get svc -o name | grep clickhouse | head -1)
kubectl -n $NS port-forward "$CH" 8123:8123 &
# 2. per-preview generated passwords (synthetic, disposable)
PGPW=$(kubectl -n $NS get secret langfuse-secrets -o jsonpath='{.data.postgres-password}' | base64 -d)
CHPW=$(kubectl -n $NS get secret langfuse-secrets -o jsonpath='{.data.clickhouse-password}' | base64 -d)
# 3. seed — overrides only the DB connection (your .env supplies the rest);
# NEXTAUTH_URL makes the CLI's printed deep links point at the preview UI
cd packages/shared
DATABASE_URL="postgresql://postgres:$PGPW@localhost:5432/postgres_langfuse" \
CLICKHOUSE_URL="http://localhost:8123" CLICKHOUSE_PASSWORD="$CHPW" \
NEXTAUTH_URL="https://pr-<N>.preview.langfuse.com" \
pnpm run seed:scenario -- deep-chain --v4
pnpm run seed:scenario -- listshows every scenario and flag; add--dry-runto predict counts and write nothing. Full catalog: theseed-test-dataskill.- The last stdout line is a JSON summary with
verifiedand clickablelinksstraight into the preview UI. - Run from a checkout whose migrations match the PR — scenario code and the
preview DB must agree, so seed from the PR's branch (usually already checked
out), not a stale
main. - Synthetic data only — same rule as everywhere else in a preview.
Debug a preview
Needs cluster access (see Getting access). Set your PR's
namespace once — the chart names everything <namespace>-<component>, so the
rest derives from it:
NS=langfuse-pr-<N> # e.g. langfuse-pr-42
What's running / healthy?
kubectl -n $NS get pods # web, worker, postgresql, clickhouse, redis, minio
kubectl -n $NS get pods,svc,ingress,pvc # fuller picture
Nothing listed? It's probably asleep off-hours — wake it (below).
App logs — usually the first stop:
kubectl -n $NS logs deploy/$NS-web --tail=200 -f # web: UI / API server
kubectl -n $NS logs deploy/$NS-worker --tail=200 -f # worker: ingestion + async jobs
Drop -f for a one-shot dump; --since=15m bounds by time; -p / --previous
shows a crashed container's logs after a restart (use for CrashLoopBackOff).
Datastore logs (single-node; get exact pod names from get pods):
kubectl -n $NS logs sts/$NS-postgresql --tail=100
CH=$(kubectl -n $NS get pods -o name | grep clickhouse | head -1)
kubectl -n $NS logs "$CH" --tail=100 # single-node ClickHouse — watch for OOM / restarts
A pod won't start (Pending / CrashLoopBackOff / ImagePullBackOff):
kubectl -n $NS describe pod <pod> # the Events list at the bottom is the reason
kubectl -n $NS get events --sort-by=.lastTimestamp | tail -30
Shell in / restart / reach it without the ALB:
kubectl -n $NS exec -it deploy/$NS-web -- sh # inspect env, curl internal services
kubectl -n $NS rollout restart deploy/$NS-web # re-roll after a fix
kubectl -n $NS port-forward deploy/$NS-web 3000:3000 # hit localhost:3000, bypassing the ALB
Wake a sleeping preview (off-hours):
kubectl annotate ns $NS downscaler/force-uptime=true --overwrite # replicas back in ~60s, ready ~3–5 min
kubectl annotate ns $NS downscaler/force-uptime- # undo later so it sleeps on schedule
Symptom → fix
| Symptom | Likely cause / fix |
|---|---|
| My preview environment is not available | Check for the preview label and inspect the AWS preview build workflow. If the PR opened with merge conflicts, resolve them; the next update adds the label. Other CI checks do not gate the preview build. |
| 🟢 build comment posted, but the URL 404s | PR author not on the deploy allowlist — the image built, nothing deployed. Add yourself (see Getting access). |
| URL not ready right after building | Build still finishing (~5 min) or a transient ImagePullBackOff — it self-heals. |
| Unresponsive at night / on a weekend | Asleep off-hours — wake it (above). |
Pods Pending, never schedule | Cluster at its preview capacity cap — close an old preview. |
| ClickHouse pod restarting / OOM | Single-node ClickHouse is the fragile piece — check its logs first. |
Getting access
- Deploy access — self-serve. Add your own GitHub login to the
authorselector ink8s/preview/bootstrap/applicationset.yaml(repolangfuse/infrastructure), open a PR, and merge tomain. Argo re-syncs and your labeled PRs deploy — no admin needed. - Cluster access — available to all Langfuse engineers (only needed to
debug with
kubectl, not to use a preview). Set up local access using the~/.aws/configprofile block from the internal Langfuse doc: https://linear.app/langfuse/document/connect-to-aws-instances-aurora-redis-from-local-machine-896fe46ff797- Open
~/.aws/configand add the[sso-session langfuse]+[profile preview]blocks from that doc (keep any[sso-session langfuse]you already have). aws sso login --profile previewaws eks update-kubeconfig --name langfuse-preview --region eu-west-1 --profile preview(no--role-arn— the role has its own EKS access entry).
- Open
Preview internals — the EKS cluster, Argo CD ApplicationSet, Helm chart, and the
admin onboarding runbook — live in the private langfuse/infrastructure repo
(k8s/preview/). Change the preview system there, not here.
Frequently asked questions about Langfuse PR Previews
Similar skills
Turborepo
Optimized build system for JavaScript/TypeScript monorepos.
Azure Pipelines Validation
Streamline your Azure DevOps pipeline changes locally.
Azure Developer CLI
Streamline your Azure project workflows with best practices.
Azure Container Registry CLI
Manage Azure Container Registry resources with ease.
Aspire
Build and orchestrate polyglot distributed applications seamlessly.
Vercel CLI
Manage and deploy Vercel projects from the command line.
