@microsoft/opentelemetry
    Preparing search index...

    Class BaggageScope

    Context manager for baggage scope.

    Manages the lifecycle of baggage values, setting them in the OTel context and restoring the previous context when the scope ends.

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Dispose is a no-op because OpenTelemetry JS automatically restores the previous context after context.with() completes.

      Returns void

    • Execute a synchronous function under this baggage scope. Automatically restores previous context afterward.

      Type Parameters

      • T

      Parameters

      • fn: () => T

      Returns T