Skip to main content

TelemetryPlugin

The TelemetryPlugin is used to instrument the Vendure application and collect telemetry data using OpenTelemetry.

Installation

npm install @vendure/telemetry-plugin
Info

For a complete guide to setting up and working with Open Telemetry, see the Implementing Open Telemetry guide.

Configuration

The plugin is configured via the TelemetryPlugin.init() method. This method accepts an options object which defines the OtelLogger options and method hooks.

Example

Ts

Preloading the SDK

In order to use the OpenTelemetry SDK, you must preload it before the Vendure server is started. This is done by using the --require flag when starting the server with a custom preload script.

Create a file named instrumentation.ts in the root of your project and add the following code:

Ts

The server would then be started with the following command:

Bash

or for development with ts-node:

Signature

options

constructor

method(methodHooksService: MethodHooksService, options: TelemetryPluginOptions) => TelemetryPlugin

init

method(options: TelemetryPluginOptions) =>
Was this chapter helpful?
Report Issue
Edited Feb 10, 2026ยทEdit this page