@sentry/node
Version:
Sentry Node SDK using OpenTelemetry for performance instrumentation
67 lines (63 loc) • 2.36 kB
JavaScript
import { instrumentHttp } from '../http.js';
import { connectIntegration, instrumentConnect } from './connect.js';
import { expressIntegration, instrumentExpress } from './express.js';
import { fastifyIntegration, instrumentFastify } from './fastify.js';
import { graphqlIntegration, instrumentGraphql } from './graphql.js';
import { hapiIntegration, instrumentHapi } from './hapi/index.js';
import { koaIntegration, instrumentKoa } from './koa.js';
import { mongoIntegration, instrumentMongo } from './mongo.js';
import { mongooseIntegration, instrumentMongoose } from './mongoose.js';
import { mysqlIntegration, instrumentMysql } from './mysql.js';
import { mysql2Integration, instrumentMysql2 } from './mysql2.js';
import { nestIntegration, instrumentNest } from './nest/nest.js';
import { postgresIntegration, instrumentPostgres } from './postgres.js';
import { redisIntegration, instrumentRedis } from './redis.js';
/**
* With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.
*/
function getAutoPerformanceIntegrations() {
return [
expressIntegration(),
fastifyIntegration(),
graphqlIntegration(),
mongoIntegration(),
mongooseIntegration(),
mysqlIntegration(),
mysql2Integration(),
redisIntegration(),
postgresIntegration(),
// For now, we do not include prisma by default because it has ESM issues
// See https://github.com/prisma/prisma/issues/23410
// TODO v8: Figure out a better solution for this, maybe only disable in ESM mode?
// prismaIntegration(),
nestIntegration(),
hapiIntegration(),
koaIntegration(),
connectIntegration(),
];
}
/**
* Get a list of methods to instrument OTEL, when preload instrumentation.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function getOpenTelemetryInstrumentationToPreload() {
return [
instrumentHttp,
instrumentExpress,
instrumentConnect,
instrumentFastify,
instrumentHapi,
instrumentKoa,
instrumentNest,
instrumentMongo,
instrumentMongoose,
instrumentMysql,
instrumentMysql2,
instrumentPostgres,
instrumentHapi,
instrumentGraphql,
instrumentRedis,
];
}
export { getAutoPerformanceIntegrations, getOpenTelemetryInstrumentationToPreload };
//# sourceMappingURL=index.js.map