Langfuse JS/TS SDKs
    Preparing search index...

    Interface PropagateAttributesParams

    Parameters for propagateAttributes function.

    interface PropagateAttributesParams {
        _internalExperiment?: PropagatedExperimentAttributes;
        asBaggage?: boolean;
        environment?: string;
        metadata?: Record<string, string>;
        prompt?: PropagatedPromptInput;
        sessionId?: string;
        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
    
    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, string>

    Additional key-value metadata to propagate to all spans.

    • Keys and values must be strings
    • All values must be ≤200 characters
    • Use for dimensions like internal correlating identifiers
    • AVOID: large payloads, sensitive data, non-string values (will be dropped with warning)

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

    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