Skip to content

Commit 755ca4e

Browse files
Vapi Taskerclaude
andcommitted
feat: document Langfuse traceName field for custom trace naming
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1b60091 commit 755ca4e

3 files changed

Lines changed: 61 additions & 0 deletions

File tree

fern/apis/api/openapi.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10172,6 +10172,10 @@
1017210172
"metadata": {
1017310173
"type": "object",
1017410174
"description": "This is a JSON object that will be added to the Langfuse trace. Traces can be enriched with metadata to better understand your users, application, and experiments. https://langfuse.com/docs/tracing-features/metadata\nBy default it includes the call metadata, assistant metadata, and assistant overrides."
10175+
},
10176+
"traceName": {
10177+
"type": "string",
10178+
"description": "Custom name for the Langfuse trace. Supports Liquid templates with the following variables: {{ call.id }} (call UUID), {{ call.type }} (inboundPhoneCall, outboundPhoneCall, webCall), {{ assistant.name }} (assistant display name), {{ assistant.id }} (assistant UUID). Example: '{{ assistant.name }} - {{ call.type }}'. Defaults to the call ID if not provided or if template rendering fails."
1017510179
}
1017610180
},
1017710181
"required": [

fern/changelog/2026-02-11.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1. **Custom Trace Names for Langfuse**: You can now customize Langfuse trace names using the new `traceName` field in [`LangfuseObservabilityPlan`](https://api.vapi.ai/api#:~:text=LangfuseObservabilityPlan). Instead of raw call IDs, use [Liquid templates](https://shopify.github.io/liquid/) with variables like `{{ assistant.name }}` and `{{ call.type }}` to create descriptive, filterable trace names. If `traceName` is not set or a template error occurs, traces fall back to the call ID. See the [Langfuse integration guide](/providers/observability/langfuse) for details.

fern/providers/observability/langfuse.mdx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,59 @@ Adding metadata and tags makes it easier to filter, analyze, and monitor your as
112112

113113
### Example
114114
![Langfuse Metadata Example](../../static/images/providers/langfuse-example.png)
115+
116+
## Custom Trace Names
117+
118+
By default, Langfuse traces are named using the raw call ID. You can customize trace names using the [`assistant.observabilityPlan.traceName`](/api-reference/assistants/create#request.body.observabilityPlan.traceName) field to make traces easier to identify and filter in your Langfuse dashboard.
119+
120+
The `traceName` field supports [Liquid templates](https://shopify.github.io/liquid/), allowing you to dynamically construct trace names from call and assistant data.
121+
122+
### Available Template Variables
123+
124+
| Variable | Description | Example Value |
125+
| --- | --- | --- |
126+
| `{{ call.id }}` | The unique call UUID | `3f4e5a6b-...` |
127+
| `{{ call.type }}` | The type of call | `inboundPhoneCall`, `outboundPhoneCall`, `webCall` |
128+
| `{{ assistant.name }}` | The assistant's display name | `Customer Support Bot` |
129+
| `{{ assistant.id }}` | The assistant's unique ID | `a1b2c3d4-...` |
130+
131+
### Examples
132+
133+
**Simple assistant name prefix:**
134+
```
135+
{{ assistant.name }} - {{ call.type }}
136+
```
137+
Produces: `Customer Support Bot - inboundPhoneCall`
138+
139+
**Call type grouping:**
140+
```
141+
{{ call.type }}/{{ assistant.name }}
142+
```
143+
Produces: `outboundPhoneCall/Sales Assistant`
144+
145+
**Include call ID for uniqueness:**
146+
```
147+
{{ assistant.name }} ({{ call.id }})
148+
```
149+
Produces: `Customer Support Bot (3f4e5a6b-...)`
150+
151+
### API Configuration
152+
153+
You can set the `traceName` field when creating or updating an assistant:
154+
155+
```json
156+
{
157+
"observabilityPlan": {
158+
"provider": "langfuse",
159+
"traceName": "{{ assistant.name }} - {{ call.type }}",
160+
"tags": ["production"],
161+
"metadata": {
162+
"env": "production"
163+
}
164+
}
165+
}
166+
```
167+
168+
<Info>
169+
If `traceName` is not provided, traces default to using the call ID. If a template rendering error occurs, the trace name also falls back safely to the call ID.
170+
</Info>

0 commit comments

Comments
 (0)