Deploy Langfuse OpenTelemetry

OTLP endpoint for LLM spans from any OTel SDK

Deploy Langfuse OpenTelemetry

/var/lib/postgresql/data

Just deployed

Just deployed

Just deployed

/var/lib/clickhouse

Just deployed

/data

langfuse-bucket

Bucket

Just deployed

Deploy and Host self hosted Langfuse OpenTelemetry (Open-Source LLM Tracing) on Railway

This template runs the Langfuse v3 stack on Railway and exposes its OTLP endpoint at https://your-domain/api/public/otel, so any OpenTelemetry SDK, Spring AI app or Collector can send LLM traces without the Langfuse SDK.

About Hosting Langfuse OpenTelemetry open-source software on Railway (self hosted Langfuse OpenTelemetry template)

This template runs a full self-hosted Langfuse v3 stack: langfuse-web on port 3000 for the UI, API and the OTLP endpoint at https://your-domain/api/public/otel, langfuse-worker for async ingestion and evals, plus Postgres, Redis, ClickHouse 24.8 and a Railway Storage Bucket in place of MinIO.

Why Deploy Langfuse OpenTelemetry, the Arize Phoenix alternative on Railway (Railway Free Trial)

Arize Phoenix is source-available under the Elastic License 2.0. This stack is MIT and takes plain OTLP, so your spans aren't tied to one vendor's SDK. Spin it up on the $5 Railway trial and point any OTLP exporter at it before you commit.

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Langfuse OpenTelemetry on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

Railway vs Other Hosting Providers and VPS for Langfuse OpenTelemetry self hosting

Railway wires Postgres, Redis, ClickHouse and the bucket before your first span; you only configure the exporter.

ProviderWhat You Get with RailwayWhat You Get with the Other Provider
DigitalOceanOne deploy, private networking, generated secrets and HTTPSDroplet plus volumes, then ClickHouse and TLS yourself
AWSManaged bucket, Postgres and ClickHouse in one projectECS, S3 and ClickHouse wiring you assemble and pay per service
HetznerSame template, billed per usageCheap VMs, but Compose fits a single host

Common Use Cases for hosted Langfuse OpenTelemetry

  • Java or Go services with no Langfuse SDK: point a plain OTLP exporter at https://your-domain/api/public/otel with the Basic auth header and spans land in Langfuse.
  • Spring AI or Vercel AI SDK telemetry: switch on built-in OTel export and let gen_ai.request.model and gen_ai.usage.* fill in model and tokens.
  • Collector fan-out: one otlphttp exporter to Langfuse, a second to your APM, so existing dashboards keep the spans they already pay for.
  • OpenLLMetry or OpenLIT instrumentation: drop the library in, set endpoint and headers, skip Langfuse-specific calls entirely.
  • User and session ids from plain spans: set langfuse.user.id and langfuse.session.id on the root span so traces group by person and conversation.

Dependencies for Langfuse OpenTelemetry Docker hosted on Railway

Railway creates every service and secret up front, so the server accepts OTLP with no tuning. Here is what gets provisioned.

Deployment Dependencies for Managed Langfuse OpenTelemetry Service (LLM Tracing)

The stack needs Postgres for users and projects, Redis for the ingestion queue (REDIS_CONNECTION_STRING carries ?family=0 so it resolves over Railway private IPv6), ClickHouse 24.8 for traces and observations with a volume at /var/lib/clickhouse, and a Railway Storage Bucket standing in for MinIO.

Implementation Details for Langfuse OpenTelemetry (Using Langfuse official docker image)

langfuse-web runs langfuse/langfuse:3 on port 3000 and serves the UI, /api/public/otel and the health check. langfuse-worker runs langfuse/langfuse-worker:3 on port 3030.

How does Langfuse OpenTelemetry compare against other LLM tracing and observability tools

Langfuse vs Arize Phoenix (OpenInference Alternative)

  • Protocol fit: Both take OTLP over HTTP, so one exporter config reaches either; Phoenix reads OpenInference attributes, Langfuse reads gen_ai.* and langfuse.*.
  • License: Phoenix is Elastic License 2.0, Langfuse core is MIT, which matters if you plan to fork or resell.
  • Where Phoenix wins: its eval workflows are tighter for pure model experimentation, and Arize's hosted product adds drift monitoring Langfuse skips.

Langfuse vs LangSmith (Closed Platform Alternative)

  • Source: LangSmith is closed source and self-hosting is Enterprise only; this stack is MIT and runs inside your Railway project.
  • Ingestion: LangSmith is happiest with its own SDK; Langfuse is fully usable from plain OTLP, so a Java service with no LangChain in sight still reports.
  • Where LangSmith wins: inside a LangChain-heavy codebase its datasets and evaluators are more polished out of the box.

Langfuse vs Helicone (Gateway Alternative)

  • Architecture: Helicone proxies calls and logs at the gateway; Langfuse stays out of the request path and takes spans from your app or a Collector.
  • Coverage: A proxy only sees proxied traffic. OTLP sends everything, including DB and HTTP spans, so you filter noise in a Collector.
  • Where Helicone wins: a base URL swap beats instrumenting a service when all you want is request logs, caching and rate limits.

Langfuse vs Datadog LLM Observability (APM Add-On Alternative)

  • Scope: Datadog ties LLM spans to the rest of your infra traces and logs; Langfuse does not try to replace that.
  • Billing and data: Datadog is a commercial add-on with usage-based billing, and traces leave your project; Langfuse keeps them in your ClickHouse.
  • Where Datadog wins: if you already run its APM, fan the same spans out from a Collector to both instead of choosing.

How to use Langfuse OpenTelemetry (the OSS LLM observability platform)?

  1. Open your Railway domain and sign up.
  2. Create a project, then copy its public and secret key.
  3. Build the auth string:
echo -n "pk-lf-...:sk-lf-..." | base64 -w 0   # drop -w 0 on macOS
  1. Set the endpoint and headers:
export OTEL_EXPORTER_OTLP_ENDPOINT=https://your-domain/api/public/otel
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic AUTH_STRING,x-langfuse-ingestion-version=4"
  1. Run your app, open Tracing, and confirm the generation has a model and token usage.

Optional: a Collector with an otlphttp exporter to the same endpoint:

exporters:
  otlphttp/langfuse:
    endpoint: https://your-domain/api/public/otel
    headers:
      Authorization: "Basic AUTH_STRING"
      x-langfuse-ingestion-version: "4"

How to self host Langfuse OpenTelemetry on other VPS Services (Langfuse self hosting guide)

Clone the Repository

Pull the repo onto the VM and check out a v3 tag.

git clone https://github.com/langfuse/langfuse.git
cd langfuse

Install Dependencies

Install Docker plus the Compose plugin. The repo's docker-compose.yml runs web, worker, Postgres, Redis, ClickHouse and MinIO on one host, fine for a test VM, not a production split.

Configure Environment Variables

Replace every value marked CHANGEME in docker-compose.yml. Set DATABASE_URL, CLICKHOUSE_URL, REDIS_CONNECTION_STRING, the S3 bucket variables, SALT, ENCRYPTION_KEY (64 hex chars), NEXTAUTH_SECRET and NEXTAUTH_URL to your public domain. Keep CLICKHOUSE_CLUSTER_ENABLED=false on a single node.

Start the Langfuse OpenTelemetry Application

Bring the stack up, then confirm https://your-domain/api/public/health returns OK before pointing any exporter at https://your-domain/api/public/otel.

docker compose up -d

Official Pricing of Langfuse OpenTelemetry (Langfuse pricing)

Self-hosted Langfuse is MIT-licensed and free with no usage limits, so the only bill is infrastructure: this six-service Railway stack with ClickHouse runs roughly $15-40/mo at low traffic. Langfuse Cloud has a free Hobby tier and paid plans billed by units; check its pricing page for current rates.

Langfuse OpenTelemetry cloud vs self hosted comparison (Pricing, features, costs, and more)

Langfuse Cloud bills by units (traces, observations, scores) with tiered retention, while this template runs the MIT core on your own Railway project with no usage limits.

Monthly cost of self hosting Langfuse OpenTelemetry on Railway

This six-service stack (web, worker, Postgres, Redis, ClickHouse, bucket) lands around $15 to $40 per month at low traffic, with ClickHouse and the storage bucket driving most of it. Nothing is metered per span.

System Requirements for Hosting Langfuse OpenTelemetry on a VPS

Official self-host docs suggest 4 cores, 16 GiB RAM and 100 GiB disk for a VM deploy.

Frequently Asked Questions (FAQs)

Does Langfuse support OTLP over gRPC?

No. Ingestion is HTTP/JSON and HTTP/protobuf only, so point exporters at https://your-domain/api/public/otel and skip gRPC.

Why do my spans take minutes to appear?

Check for x-langfuse-ingestion-version=4 in OTEL_EXPORTER_OTLP_HEADERS; without it data can take up to about 10 minutes to show.

Why is the model name or cost missing?

Send gen_ai.request.model and gen_ai.response.model plus gen_ai.usage.*, or the langfuse.observation equivalents. No model and no cost_details means no cost.

How do I set user and session ids on plain OTel spans?

Set langfuse.user.id and langfuse.session.id on every span, or on the root span with a BaggageSpanProcessor. The root also gives the trace its name and output.

Can I send the same spans to Langfuse and Datadog?

Yes. In a Collector, add an otlphttp/langfuse exporter and a second exporter for Datadog, plus a filter processor for noisy HTTP spans.

Do I still need the Langfuse SDK?

No. OpenLLMetry, OpenLIT, Spring AI and Vercel AI SDK telemetry all work; the Langfuse SDKs are built on OTel and add LLM-only span filtering plus helpers.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
NEW
Möbius v0.1 Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

bento
1
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
7