enableOpenTelemetry MethodStatic

Enable logging to OpenTelemetry. withSpan will be enabled, all log entries will be attached to active span as span events. IModelHost.startup will call this automatically if the enableOpenTelemetry option is enabled and it succeeds in requiring @opentelemetry/api.

enableOpenTelemetry(tracer: Tracer, api: { context: Pick<ContextAPI, "active" | "with">, trace: Pick<TraceAPI, "setSpan" | "setSpanContext" | "getSpan"> }): void

@note Node.js OpenTelemetry SDK should be initialized by the user.

Parameter Type Description
tracer Tracer  
api { context: Pick<ContextAPI, "active" | "with">, trace: Pick<TraceAPI, "setSpan" | "setSpanContext" | "getSpan"> }  

Returns - void

Defined in

Last Updated: 21 November, 2024