forked from getsentry/sentry-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
68 lines (65 loc) · 2.37 KB
/
index.ts
File metadata and controls
68 lines (65 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import type { Integration } from '@sentry/types';
import { instrumentHttp } from '../http';
import { connectIntegration, instrumentConnect } from './connect';
import { expressIntegration, instrumentExpress } from './express';
import { fastifyIntegration, instrumentFastify } from './fastify';
import { graphqlIntegration, instrumentGraphql } from './graphql';
import { hapiIntegration, instrumentHapi } from './hapi';
import { instrumentKnex, knexIntegration } from './knex';
import { instrumentKoa, koaIntegration } from './koa';
import { instrumentMongo, mongoIntegration } from './mongo';
import { instrumentMongoose, mongooseIntegration } from './mongoose';
import { instrumentMysql, mysqlIntegration } from './mysql';
import { instrumentMysql2, mysql2Integration } from './mysql2';
import { instrumentNest, nestIntegration } from './nest/nest';
import { instrumentPostgres, postgresIntegration } from './postgres';
import { instrumentRedis, redisIntegration } from './redis';
/**
* With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.
*/
export function getAutoPerformanceIntegrations(): Integration[] {
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(),
knexIntegration(),
];
}
/**
* Get a list of methods to instrument OTEL, when preload instrumentation.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & { id: string })[] {
return [
instrumentHttp,
instrumentExpress,
instrumentConnect,
instrumentFastify,
instrumentHapi,
instrumentKoa,
instrumentNest,
instrumentMongo,
instrumentMongoose,
instrumentMysql,
instrumentMysql2,
instrumentPostgres,
instrumentHapi,
instrumentGraphql,
instrumentRedis,
instrumentKnex,
];
}