Langfuse
Send LLM traces to Langfuse for observability, evaluation, and debugging.
Langfuse is an open-source LLM engineering platform for tracing, evaluation, prompt management, and metrics. Connect it to EUrouter to automatically capture every request as a Langfuse trace.
Setup
Get your Langfuse credentials
- Sign in to Langfuse (or your self-hosted instance)
- Go to Settings in your project
- Copy your Secret Key and Public Key
For more details, see Where are my Langfuse API keys?
Add the destination in EUrouter
- Go to Broadcast in your dashboard
- Click Add Destination next to Langfuse
- Enter your Secret Key and Public Key
- If you're self-hosting, update the Base URL (default:
https://cloud.langfuse.com) - Click Test Connection to verify
- Click Create
Configuration
| Field | Required | Description |
|---|---|---|
| Secret Key | Yes | Your Langfuse secret key (sk-lf-...) |
| Public Key | Yes | Your Langfuse public key (pk-lf-...) |
| Base URL | No | Custom endpoint for self-hosted Langfuse. Default: https://cloud.langfuse.com |
What you'll see in Langfuse
Once connected, each EUrouter request appears as a trace in Langfuse with:
- Model name and provider
- Input/output messages (only for API keys with prompt forwarding switched on)
- Token usage and cost
- Latency and timing breakdown
- Any custom metadata passed via the
tracefield
Custom metadata
You can enrich Langfuse traces by including a trace field in your EUrouter requests:
{
"model": "mistral-large-3",
"messages": [{ "role": "user", "content": "Hello!" }],
"trace": {
"trace_id": "workflow_123",
"trace_name": "Customer Support",
"generation_name": "Initial Response",
"user_id": "user_456",
"session_id": "session_789"
}
}Langfuse recognizes these keys:
| Key | Description |
|---|---|
trace_id | Group multiple requests into a single Langfuse trace |
trace_name | Display name for the trace (defaults to model name) |
generation_name | Name for the specific LLM generation |
user_id | Associate the trace with a specific user |
session_id | Group traces into a Langfuse session |
Decision fields
Every generation carries the decision EUrouter made for the request, as span attributes that Langfuse shows in the observation's metadata.
| Attribute | Type | Description |
|---|---|---|
eurouter.decision | string | allowed, redacted, blocked or error |
eurouter.reason_codes | string[] | Reason codes, such as pii.blocked or plan.rate_limited |
eurouter.pii_counts.<type> | int | Detected PII per type, for example eurouter.pii_counts.email |
eurouter.processing_countries | string[] | ISO country codes where the request was processed |
http.response.status_code | int | HTTP status EUrouter returned |
error.type | string | Blocked and failed requests only: the first reason code, or the decision |
A blocked or failed request shows with level ERROR and a status message such as blocked: pii.blocked. Every trace
has a decision:<value> tag, so you can filter on decision:blocked.
Blocked and rejected requests arrive too, with zero tokens, no cost and never a prompt. See the decision record for the values.