Thanks to visit codestin.com
Credit goes to docs.nocobase.com

Telemetry

Overview

Telemetry is the telemetry module of NocoBase, encapsulating OpenTelemetry support for registering metrics and traces within the OpenTelemetry ecosystem.

Class Methods

constructor()

Constructor to create a Telemetry instance.

Signature

  • constructor(options?: TelemetryOptions)

Type

export interface TelemetryOptions {
  serviceName?: string;
  version?: string;
  trace?: TraceOptions;
  metric?: MetricOptions;
}

Details

PropertyTypeDescriptionDefault Value
serviceNamestringOptional. Refer to Semantic Conventionsnocobase
versionstringOptional. Refer to Semantic ConventionsOptional, current NocoBase version
traceTraceOptionsOptional. Refer to Trace-
metricMetricOptionsOptional. Refer to Metric-

init()

Registers instrumentation and initializes Trace and Metric.

Signature

  • init(): void

start()

Starts the processing of Trace and Metric related data, such as exporting to Prometheus.

Signature

  • start(): void

shutdown()

Stops the processing of Trace and Metric related data.

Signature

  • shutdown(): Promise<void>

addInstrumentation()

Adds instrumentation libraries.

Signature

  • addInstrumentation(...instrumentation: InstrumentationOption[])