Optional Internal_INTERNAL USE ONLY - For Langfuse experiment framework.
This parameter is used internally by the Langfuse experiment system to propagate experiment context to child spans. It should NOT be used by external code.
OptionalasIf true, propagates attributes using OpenTelemetry baggage for cross-process/service propagation.
Security warning: When enabled, attribute values are added to HTTP headers on ALL outbound requests. Only enable if values are safe to transmit via HTTP headers and you need cross-service tracing.
OptionalenvironmentLangfuse environment to associate with all spans in this context.
Must be a lowercase alphanumeric string with optional hyphens or underscores,
must be ≤40 characters, and must not start with langfuse. This maps to the
first-class langfuse.environment attribute, not to trace metadata.
A propagated environment takes precedence over the default configured on
LangfuseSpanProcessor or via LANGFUSE_TRACING_ENVIRONMENT while this
propagation scope is active.
OptionalmetadataAdditional key-value metadata to propagate to all spans.
OptionalpromptLangfuse prompt to link to observations created within this context.
Accepts a prompt client returned by langfuse.prompt.get(...) or any plain
object exposing name (non-empty string) and version (integer) — e.g.
{ name: "my-prompt", version: 3 }. This is the recommended way to link
prompts to generations emitted by auto-instrumentation libraries (e.g.
OpenInference, other OTel instrumentations) where you don't create the
generation via the Langfuse SDK yourself.
The prompt link is only applied to generation-type observations by the
Langfuse backend. Fallback prompts are never linked. An explicit prompt
set directly on an observation takes precedence over the propagated one.
OptionalsessionSession identifier to associate with all spans in this context. Must be a string ≤200 characters. Use this to group related traces within a user session (e.g., a conversation thread, multi-turn interaction).
OptionaltagsList of tags to categorize the group of observations
OptionaltraceTrace name to associate with all spans in this context. Must be a string ≤200 characters.
OptionaluserUser identifier to associate with all spans in this context. Must be a string ≤200 characters. Use this to track which user generated each trace and enable e.g. per-user cost/performance analysis.
OptionalversionVersion identifier for parts of your application that are independently versioned, e.g. agents
Parameters for propagateAttributes function.