Creates a configuration object for the OpenTelemetry Node SDK. This is used to set up a custom
preload script which must be run before the main Vendure server is loaded by means of the
Node.js --require flag.
The default instrumentations array covers the libraries Vendure itself uses: HTTP, Express,
NestJS, GraphQL, the PostgreSQL and MySQL2 database drivers, ioredis, plus Node.js runtime
metrics (event-loop lag, GC pause, heap, CPU). SQLite (better-sqlite3) has no OpenTelemetry
instrumentation available upstream and is therefore not covered. To capture spans from other
libraries used in your own plugins (for example kafkajs, mongoose, winston), install the
specific @opentelemetry/instrumentation-* package you need and extend the defaults via
getDefaultInstrumentations():
Passing your own instrumentations via config.instrumentations replaces the curated default
entirely.
Example
This would them be run as:
Parameters
SdkConfigurationOptionsReturns a fresh array of the OpenTelemetry instrumentations Vendure enables by default. Callers
can spread this into their own instrumentations array to add extra integrations without
losing the curated set.
Options for configuring the OpenTelemetry Node SDK.