เอกสารนี้แปลโดย AI สำหรับข้อมูลที่ถูกต้อง กรุณาดูเวอร์ชันภาษาอังกฤษ
constructor()คอนสตรัคเตอร์ (Constructor) สำหรับสร้างอินสแตนซ์ของ Trace ครับ
constructor(options?: TraceOptions)| คุณสมบัติ | ประเภท | คำอธิบาย | ค่าเริ่มต้น |
|---|---|---|---|
tracerName | string | ตัวระบุ (Identifier) ของ Trace | nocobase-trace |
version | string | เวอร์ชันปัจจุบันของ NocoBase | |
processorName | string | string[] | ตัวระบุของ SpanProcessor ที่ลงทะเบียนไว้และต้องการเปิดใช้งาน |
init()เริ่มต้นการทำงาน (Initialize) ของ NodeTracerProvider ครับ
init(): voidregisterProcessor()ลงทะเบียน SpanProcessor ครับ
registerProcessor(name: string, processor: GetSpanProcessor)| พารามิเตอร์ | ประเภท | คำอธิบาย |
|---|---|---|
name | string | ตัวระบุเฉพาะ (Unique identifier) สำหรับ SpanProcessor |
processor | () => SpanProcessor | เมธอดสำหรับรับค่า SpanProcessor |
getTracer()รับค่า Tracer ครับ
getTracer(name?: string, version?: string)| พารามิเตอร์ | ประเภท | คำอธิบาย | ค่าเริ่มต้น |
|---|---|---|---|
name | string | ตัวระบุของ Trace | nocobase-trace |
version | string | เวอร์ชันปัจจุบันของ NocoBase |
start()เริ่มต้นการทำงานของ SpanProcessor ครับ
start(): voidshutdown()หยุดการทำงานของ SpanProcessor ครับ
shutdown(): Promise<void>