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.
OptionalattachAttach the processor's skills.available to new spans in this scope. Affects tracing only; explicit skillsAvailable take precedence. Nested scopes can opt out with false. Never sent as an attribute or baggage.
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.
"prod" → '"prod"', "123" → '"123"',
42 → "42", [1, "a"] → '[1,"a"]'), so the server keeps the
string "123" apart from the number 123null, undefined, functions and symbols are dropped with a warningOptionalpromptLangfuse 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).
OptionalskillsSkills available to generations in this scope, provided as names and optional versions. Updates the active observation and propagates to new child spans. Nested lists replace the outer list; an empty array clears it. Local to this process, even when asBaggage is enabled.
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.