Langfuse JS/TS SDKs
    Preparing search index...

    Interface PropagateAttributesParams

    Parameters for propagateAttributes function.

    interface PropagateAttributesParams {
        _internalExperiment?: PropagatedExperimentAttributes;
        asBaggage?: boolean;
        attachSkills?: boolean;
        environment?: string;
        metadata?: Record<string, unknown>;
        prompt?: PropagatedPromptInput;
        sessionId?: string;
        skillsAvailable?: SkillReference[];
        tags?: string[];
        traceName?: string;
        userId?: string;
        version?: string;
    }
    Index

    Properties

    _internalExperiment?: PropagatedExperimentAttributes

    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.

    asBaggage?: boolean

    If 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.

    false
    
    attachSkills?: boolean

    Attach 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.

    environment?: string

    Langfuse 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.

    metadata?: Record<string, unknown>

    Additional key-value metadata to propagate to all spans.

    • Every value is JSON-encoded, strings included, the same way as observation metadata (e.g. "prod" → '"prod"', "123" → '"123"', 42 → "42", [1, "a"] → '[1,"a"]'), so the server keeps the string "123" apart from the number 123
    • null, undefined, functions and symbols are dropped with a warning
    • Encoded values must be ≤200 characters, otherwise they are dropped with a warning
    • Use for dimensions like internal correlating identifiers
    • AVOID: large payloads, sensitive data

    Langfuse 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.

    sessionId?: string

    Session 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).

    skillsAvailable?: SkillReference[]

    Skills 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.

    tags?: string[]

    List of tags to categorize the group of observations

    traceName?: string

    Trace name to associate with all spans in this context. Must be a string ≤200 characters.

    userId?: string

    User 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.

    version?: string

    Version identifier for parts of your application that are independently versioned, e.g. agents