propagateAttributes()
propagateAttributes()
Attach customer identifiers and metadata to all spans in a scope.
await respan.propagateAttributes({customer_identifier: "user_123",thread_identifier: "conv_001",metadata: { plan: "pro" },},async () => {// All spans created here inherit these attributesawait respan.withWorkflow({ name: "handle_request" }, async () => {const response = await client.chat.completions.create({model: "gpt-4o-mini",messages: [{ role: "user", content: "Hello" }],});});});
| Attribute | Type | Description |
|---|---|---|
customer_identifier | string | End user identifier |
thread_identifier | string | Conversation thread ID |
metadata | Record<string, any> | Custom key-value pairs |