Telemetry is the telemetry module of NocoBase, encapsulating OpenTelemetry support for registering metrics and traces within the OpenTelemetry ecosystem.
constructor()Constructor to create a Telemetry instance.
constructor(options?: TelemetryOptions)| Property | Type | Description | Default Value |
|---|---|---|---|
serviceName | string | Optional. Refer to Semantic Conventions | nocobase |
version | string | Optional. Refer to Semantic Conventions | Optional, current NocoBase version |
trace | TraceOptions | Optional. Refer to Trace | - |
metric | MetricOptions | Optional. Refer to Metric | - |
init()Registers instrumentation and initializes Trace and Metric.
init(): voidstart()Starts the processing of Trace and Metric related data, such as exporting to Prometheus.
start(): voidshutdown()Stops the processing of Trace and Metric related data.
shutdown(): Promise<void>addInstrumentation()Adds instrumentation libraries.
addInstrumentation(...instrumentation: InstrumentationOption[])