BaggageBuilder class

Na żądanie konstruktor bagażu dla propagacji kontekstu OpenTelemetry.

Ta klasa zapewnia płynny interfejs API do ustawiania wartości bagażu, które będą propagowane w kontekście OpenTelemetry.

Przykład

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

scope.enter();
// Baggage is set in this context
// ... do work ...
scope.exit();
// Baggage is restored after exiting the context

Metody

agentAuid(undefined | null | string)

Ustaw wartość bagażu AUID agenta.

agentBlueprintId(undefined | null | string)

Ustaw wartość bagażu identyfikatora planu agenta.

agentDescription(undefined | null | string)

Ustaw wartość bagażu opisu agenta.

agentEmail(undefined | null | string)

Ustaw wartość bagażu e-mail agenta.

agentId(undefined | null | string)

Ustaw wartość bagażu identyfikatora agenta.

agentName(undefined | null | string)

Ustaw wartość bagażu nazwy agenta.

agentPlatformId(undefined | null | string)

Ustaw wartość bagażu identyfikatora platformy agenta.

agentVersion(undefined | null | string)

Ustaw wartość bagażu wersji agenta.

build()

Zastosuj zebrany bagaż do bieżącego kontekstu.

callerAgentPlatformId(undefined | null | string)

Ustaw wartość bagażu identyfikatora bagażu agenta rozmówców.

callerClientIp(undefined | null | string)

Ustaw wartość bagażu IP klienta wywołującego. Służy do przechwytywania źródłowego adresu IP klienta dla żądania, aby można było go propagować za pośrednictwem bagażu OpenTelemetry.

channelLink(undefined | null | string)

Ustaw link/adres URL kanału.

channelName(undefined | null | string)

Ustaw nazwę kanału (np. Teams, Slack).

conversationId(undefined | null | string)

Ustaw wartość bagażu identyfikatora konwersacji.

conversationItemLink(undefined | null | string)

Ustaw wartość bagażu połączonego z elementem konwersacji.

invokeAgentServer(undefined | null | string, number)

Ustawia wartości adresu serwera agenta i bagażu portowego.

operationSource(undefined | null | string)

Ustaw wartość bagażu źródłowego operacji. Służy do określania zakresu serwerów (np. ATG, ACF).

sessionDescription(undefined | null | string)

Ustaw wartość bagażu opisu sesji.

sessionId(string)

Ustaw wartość bagażu identyfikatora sesji.

setPairs(undefined | null | Record<string, any> | Iterable<[string, any]>)

Ustaw wiele par bagażu ze słownika lub iterowalne.

setRequestContext(null | string, null | string)

Wygodna metoda rozpoczęcia zakresu bagażu żądania z typowymi polami.

tenantId(undefined | null | string)

Ustaw wartość bagażu identyfikatora dzierżawy.

userEmail(undefined | null | string)

Ustaw wartość bagażu e-mail użytkownika.

userId(undefined | null | string)

Ustaw wartość bagażu identyfikatora użytkownika.

userName(undefined | null | string)

Ustaw wartość bagażu nazwy użytkownika.

Szczegóły metody

agentAuid(undefined | null | string)

Ustaw wartość bagażu AUID agenta.

function agentAuid(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Identyfikator AUID agenta

Zwraca

Self for method chaining (Self for method chaining)

agentBlueprintId(undefined | null | string)

Ustaw wartość bagażu identyfikatora planu agenta.

function agentBlueprintId(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Identyfikator strategii agenta

Zwraca

Self for method chaining (Self for method chaining)

agentDescription(undefined | null | string)

Ustaw wartość bagażu opisu agenta.

function agentDescription(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Opis agenta

Zwraca

Self for method chaining (Self for method chaining)

agentEmail(undefined | null | string)

Ustaw wartość bagażu e-mail agenta.

function agentEmail(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Wiadomość e-mail agenta

Zwraca

Self for method chaining (Self for method chaining)

agentId(undefined | null | string)

Ustaw wartość bagażu identyfikatora agenta.

function agentId(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Identyfikator agenta

Zwraca

Self for method chaining (Self for method chaining)

agentName(undefined | null | string)

Ustaw wartość bagażu nazwy agenta.

function agentName(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Nazwa agenta

Zwraca

Self for method chaining (Self for method chaining)

agentPlatformId(undefined | null | string)

Ustaw wartość bagażu identyfikatora platformy agenta.

function agentPlatformId(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Identyfikator platformy agenta

Zwraca

Self for method chaining (Self for method chaining)

agentVersion(undefined | null | string)

Ustaw wartość bagażu wersji agenta.

function agentVersion(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Wersja agenta (np. "1.0.0", "2025-05-01")

Zwraca

Self for method chaining (Self for method chaining)

build()

Zastosuj zebrany bagaż do bieżącego kontekstu.

function build(): BaggageScope

Zwraca

Menedżer kontekstu, który przywraca poprzedni bagaż podczas wyjścia

callerAgentPlatformId(undefined | null | string)

Ustaw wartość bagażu identyfikatora bagażu agenta rozmówców.

function callerAgentPlatformId(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Identyfikator platformy agenta wywołującego

Zwraca

Self for method chaining (Self for method chaining)

callerClientIp(undefined | null | string)

Ustaw wartość bagażu IP klienta wywołującego. Służy do przechwytywania źródłowego adresu IP klienta dla żądania, aby można było go propagować za pośrednictwem bagażu OpenTelemetry.

function callerClientIp(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Adres IP klienta wywołującego

Zwraca

Self for method chaining (Self for method chaining)

Ustaw link/adres URL kanału.

function channelLink(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Link kanału

Zwraca

Self for method chaining (Self for method chaining)

channelName(undefined | null | string)

Ustaw nazwę kanału (np. Teams, Slack).

function channelName(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Nazwa kanału

Zwraca

Self for method chaining (Self for method chaining)

conversationId(undefined | null | string)

Ustaw wartość bagażu identyfikatora konwersacji.

function conversationId(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Identyfikator konwersacji

Zwraca

Self for method chaining (Self for method chaining)

Ustaw wartość bagażu połączonego z elementem konwersacji.

function conversationItemLink(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Link do elementu konwersacji

Zwraca

Self for method chaining (Self for method chaining)

invokeAgentServer(undefined | null | string, number)

Ustawia wartości adresu serwera agenta i bagażu portowego.

function invokeAgentServer(address: undefined | null | string, port?: number): BaggageBuilder

Parametry

address

undefined | null | string

Adres serwera (nazwa hosta) usługi agenta docelowego.

port

number

Opcjonalny port serwera. Rejestrowane tylko wtedy, gdy różni się od 443.

Zwraca

Bieżące wystąpienie konstruktora służące do tworzenia łańcuchów metod.

operationSource(undefined | null | string)

Ustaw wartość bagażu źródłowego operacji. Służy do określania zakresu serwerów (np. ATG, ACF).

function operationSource(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Źródło operacji

Zwraca

Self for method chaining (Self for method chaining)

sessionDescription(undefined | null | string)

Ustaw wartość bagażu opisu sesji.

function sessionDescription(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Opis sesji

Zwraca

Self for method chaining (Self for method chaining)

sessionId(string)

Ustaw wartość bagażu identyfikatora sesji.

function sessionId(value: string): BaggageBuilder

Parametry

value

string

Identyfikator sesji

Zwraca

Self for method chaining (Self for method chaining)

setPairs(undefined | null | Record<string, any> | Iterable<[string, any]>)

Ustaw wiele par bagażu ze słownika lub iterowalne.

function setPairs(pairs: undefined | null | Record<string, any> | Iterable<[string, any]>): BaggageBuilder

Parametry

pairs

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

Słownik lub iterable par klucz-wartość

Zwraca

Self for method chaining (Self for method chaining)

setRequestContext(null | string, null | string)

Wygodna metoda rozpoczęcia zakresu bagażu żądania z typowymi polami.

static function setRequestContext(tenantId?: null | string, agentId?: null | string): BaggageScope

Parametry

tenantId

null | string

Identyfikator dzierżawy

agentId

null | string

Identyfikator agenta

Zwraca

Menedżer kontekstu, który przywraca poprzedni bagaż podczas wyjścia

tenantId(undefined | null | string)

Ustaw wartość bagażu identyfikatora dzierżawy.

function tenantId(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Identyfikator dzierżawy

Zwraca

Self for method chaining (Self for method chaining)

userEmail(undefined | null | string)

Ustaw wartość bagażu e-mail użytkownika.

function userEmail(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Adres e-mail użytkownika

Zwraca

Self for method chaining (Self for method chaining)

userId(undefined | null | string)

Ustaw wartość bagażu identyfikatora użytkownika.

function userId(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Identyfikator użytkownika

Zwraca

Self for method chaining (Self for method chaining)

userName(undefined | null | string)

Ustaw wartość bagażu nazwy użytkownika.

function userName(value: undefined | null | string): BaggageBuilder

Parametry

value

undefined | null | string

Nazwa użytkownika

Zwraca

Self for method chaining (Self for method chaining)