@microsoft/opentelemetry
    Preparing search index...

    Class BaggageBuilder

    Fluent builder for setting OpenTelemetry baggage values.

    const scope = new BaggageBuilder()
    .tenantId("tenant-123")
    .agentId("agent-456")
    .build();

    scope.run(() => {
    // Baggage is active in this context
    });
    Index

    Constructors

    Methods

    • Sets the invoke agent server address and port baggage values.

      Parameters

      • address: string | null | undefined

        The server address (hostname) of the target agent service.

      • Optionalport: number

        Optional server port. Only recorded when different from 443.

      Returns BaggageBuilder

    • Set multiple baggage pairs from a dictionary or iterable.

      Parameters

      • pairs: Record<string, any> | Iterable<[string, any], any, any> | null | undefined

        Dictionary or iterable of key-value pairs

      Returns BaggageBuilder

    • Convenience method to begin a request baggage scope with common fields.

      Parameters

      • OptionaltenantId: string | null

        The tenant ID

      • OptionalagentId: string | null

        The agent ID

      Returns BaggageScope

      A BaggageScope with tenant and agent ID set