BaggageBuilder class

ต่อคําขอตัวสร้างสัมภาระสําหรับการเผยแพร่บริบท OpenTelemetry

ระดับนี้ให้ API คล่องตัวในการตั้งค่าสัมภาระที่จะถูกเผยแพร่ในบริบท OpenTelemetry

ตัวอย่าง

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

วิธีการ

agentAuid(undefined | null | string)

ตั้งค่าค่าสัมภาระ AUID ของตัวแทน

agentBlueprintId(undefined | null | string)

ตั้งค่าค่าสัมภาระของรหัสพิมพ์เขียวของตัวแทน

agentDescription(undefined | null | string)

ตั้งค่าสัมภาระคําอธิบายของตัวแทน

agentEmail(undefined | null | string)

ตั้งค่าสัมภาระทางอีเมลของตัวแทน

agentId(undefined | null | string)

ตั้งค่าสัมภาระ ID ตัวแทน

agentName(undefined | null | string)

ตั้งค่าชื่อสัมภาระของตัวแทน

agentPlatformId(undefined | null | string)

ตั้งค่าสัมภาระ ID แพลตฟอร์มตัวแทน

agentVersion(undefined | null | string)

ตั้งค่าสัมภาระเวอร์ชันของตัวแทน

build()

นําสัมภาระที่รวบรวมไปใช้กับบริบทปัจจุบัน

callerAgentPlatformId(undefined | null | string)

ตั้งค่าค่าสัมภาระของ ID แพลตฟอร์มผู้โทร

callerClientIp(undefined | null | string)

ตั้งค่าสัมภาระ IP ของไคลเอ็นต์ผู้โทร ใช้เพื่อจับ IP ไคลเอ็นต์ต้นทางสําหรับคําขอ เพื่อให้สามารถเผยแพร่ผ่านสัมภาระ OpenTelemetry

channelLink(undefined | null | string)

ตั้งค่าลิงก์/URL ของช่อง

channelName(undefined | null | string)

ตั้งชื่อช่อง (เช่น Teams, Slack)

conversationId(undefined | null | string)

ตั้งค่าสัมภาระของ ID การสนทนา

conversationItemLink(undefined | null | string)

ตั้งค่าสัมภาระที่ลิงก์รายการการสนทนา

invokeAgentServer(undefined | null | string, number)

ตั้งค่าที่อยู่เซิร์ฟเวอร์ตัวแทนการเรียกใช้และค่าสัมภาระพอร์ต

operationSource(undefined | null | string)

ตั้งค่าสัมภาระต้นทางของการดําเนินงาน ใช้สําหรับเซิร์ฟเวอร์ที่ขยายไปเพื่อระบุบริการ (เช่น ATG, ACF)

sessionDescription(undefined | null | string)

ตั้งค่าคําอธิบายเกี่ยวกับค่าสัมภาระของเซสชัน

sessionId(string)

ตั้งค่า ID ค่าสัมภาระของเซสชัน

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

ตั้งค่าคู่สัมภาระหลายคู่จากพจนานุกรมหรือสามารถทําสําเนาได้

setRequestContext(null | string, null | string)

วิธีการที่สะดวกในการเริ่มต้นขอบเขตคําขอสัมภาระที่มีเขตข้อมูลทั่วไป

tenantId(undefined | null | string)

ตั้งค่าโควต้าผู้เช่าค่าสัมภาระ

userEmail(undefined | null | string)

ตั้งค่าสัมภาระทางอีเมลของผู้ใช้

userId(undefined | null | string)

ตั้งค่าสัมภาระ ID ผู้ใช้

userName(undefined | null | string)

ตั้งค่าสัมภาระของชื่อผู้ใช้

รายละเอียดวิธีการ

agentAuid(undefined | null | string)

ตั้งค่าค่าสัมภาระ AUID ของตัวแทน

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

พารามิเตอร์

value

undefined | null | string

AUID ของตัวแทน

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

agentBlueprintId(undefined | null | string)

ตั้งค่าค่าสัมภาระของรหัสพิมพ์เขียวของตัวแทน

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

พารามิเตอร์

value

undefined | null | string

รหัสพิมพ์เขียวของตัวแทน

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

agentDescription(undefined | null | string)

ตั้งค่าสัมภาระคําอธิบายของตัวแทน

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

พารามิเตอร์

value

undefined | null | string

คําอธิบายของตัวแทน

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

agentEmail(undefined | null | string)

ตั้งค่าสัมภาระทางอีเมลของตัวแทน

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

พารามิเตอร์

value

undefined | null | string

อีเมลของตัวแทน

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

agentId(undefined | null | string)

ตั้งค่าสัมภาระ ID ตัวแทน

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

พารามิเตอร์

value

undefined | null | string

รหัสเอเจนต์

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

agentName(undefined | null | string)

ตั้งค่าชื่อสัมภาระของตัวแทน

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

พารามิเตอร์

value

undefined | null | string

ชื่อตัวแทน

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

agentPlatformId(undefined | null | string)

ตั้งค่าสัมภาระ ID แพลตฟอร์มตัวแทน

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

พารามิเตอร์

value

undefined | null | string

ID แพลตฟอร์มตัวแทน

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

agentVersion(undefined | null | string)

ตั้งค่าสัมภาระเวอร์ชันของตัวแทน

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

พารามิเตอร์

value

undefined | null | string

เวอร์ชันของตัวแทน (เช่น '1.0.0', '2025-05-01')

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

build()

นําสัมภาระที่รวบรวมไปใช้กับบริบทปัจจุบัน

function build(): BaggageScope

การส่งคืน

ตัวจัดการบริบทที่กู้คืนสัมภาระก่อนหน้าเมื่อออก

callerAgentPlatformId(undefined | null | string)

ตั้งค่าค่าสัมภาระของ ID แพลตฟอร์มผู้โทร

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

พารามิเตอร์

value

undefined | null | string

ตัวระบุแพลตฟอร์มตัวแทนการโทร

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

callerClientIp(undefined | null | string)

ตั้งค่าสัมภาระ IP ของไคลเอ็นต์ผู้โทร ใช้เพื่อจับ IP ไคลเอ็นต์ต้นทางสําหรับคําขอ เพื่อให้สามารถเผยแพร่ผ่านสัมภาระ OpenTelemetry

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

พารามิเตอร์

value

undefined | null | string

ที่อยู่ IP ของไคลเอ็นต์ผู้เรียก

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

ตั้งค่าลิงก์/URL ของช่อง

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

พารามิเตอร์

value

undefined | null | string

ลิงก์ช่อง

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

channelName(undefined | null | string)

ตั้งชื่อช่อง (เช่น Teams, Slack)

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

พารามิเตอร์

value

undefined | null | string

ชื่อช่อง

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

conversationId(undefined | null | string)

ตั้งค่าสัมภาระของ ID การสนทนา

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

พารามิเตอร์

value

undefined | null | string

ID การสนทนา

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

ตั้งค่าสัมภาระที่ลิงก์รายการการสนทนา

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

พารามิเตอร์

value

undefined | null | string

ลิงก์รายการการสนทนา

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

invokeAgentServer(undefined | null | string, number)

ตั้งค่าที่อยู่เซิร์ฟเวอร์ตัวแทนการเรียกใช้และค่าสัมภาระพอร์ต

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

พารามิเตอร์

address

undefined | null | string

ที่อยู่เซิร์ฟเวอร์ (ชื่อโฮสต์) ของบริการของบริษัทตัวแทนเป้าหมาย

port

number

พอร์ตเซิร์ฟเวอร์ที่เลือกได้ บันทึกเมื่อแตกต่างจาก 443 เท่านั้น

การส่งคืน

อินสแตนซ์ตัวสร้างปัจจุบันสําหรับการเชื่อมโยงวิธีการ

operationSource(undefined | null | string)

ตั้งค่าสัมภาระต้นทางของการดําเนินงาน ใช้สําหรับเซิร์ฟเวอร์ที่ขยายไปเพื่อระบุบริการ (เช่น ATG, ACF)

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

พารามิเตอร์

value

undefined | null | string

แหล่งการดําเนินการ

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

sessionDescription(undefined | null | string)

ตั้งค่าคําอธิบายเกี่ยวกับค่าสัมภาระของเซสชัน

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

พารามิเตอร์

value

undefined | null | string

คําอธิบายเซสชัน

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

sessionId(string)

ตั้งค่า ID ค่าสัมภาระของเซสชัน

function sessionId(value: string): BaggageBuilder

พารามิเตอร์

value

string

รหัสเซสชัน

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

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

ตั้งค่าคู่สัมภาระหลายคู่จากพจนานุกรมหรือสามารถทําสําเนาได้

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

พารามิเตอร์

pairs

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

พจนานุกรมหรือสามารถทําสําเนาของคู่ค่าคีย์

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

setRequestContext(null | string, null | string)

วิธีการที่สะดวกในการเริ่มต้นขอบเขตคําขอสัมภาระที่มีเขตข้อมูลทั่วไป

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

พารามิเตอร์

tenantId

null | string

รหัสผู้เช่า

agentId

null | string

รหัสเอเจนต์

การส่งคืน

ตัวจัดการบริบทที่กู้คืนสัมภาระก่อนหน้าเมื่อออก

tenantId(undefined | null | string)

ตั้งค่าโควต้าผู้เช่าค่าสัมภาระ

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

พารามิเตอร์

value

undefined | null | string

รหัสผู้เช่า

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

userEmail(undefined | null | string)

ตั้งค่าสัมภาระทางอีเมลของผู้ใช้

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

พารามิเตอร์

value

undefined | null | string

อีเมลผู้ใช้

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

userId(undefined | null | string)

ตั้งค่าสัมภาระ ID ผู้ใช้

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

พารามิเตอร์

value

undefined | null | string

ID ผู้ใช้

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ

userName(undefined | null | string)

ตั้งค่าสัมภาระของชื่อผู้ใช้

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

พารามิเตอร์

value

undefined | null | string

ชื่อผู้ใช้

การส่งคืน

ด้วยตนเองสําหรับการเชื่อมโยงวิธีการ