-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathindex.ts
79 lines (76 loc) · 2.76 KB
/
index.ts
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
69
70
71
72
73
74
75
76
77
78
79
import type { Integration } from '@sentry/core';
import { instrumentOtelHttp } from '../http';
import { amqplibIntegration, instrumentAmqplib } from './amqplib';
import { connectIntegration, instrumentConnect } from './connect';
import { expressIntegration, instrumentExpress, instrumentExpressV5 } from './express';
import { fastifyIntegration, instrumentFastify } from './fastify';
import { genericPoolIntegration, instrumentGenericPool } from './genericPool';
import { graphqlIntegration, instrumentGraphql } from './graphql';
import { hapiIntegration, instrumentHapi } from './hapi';
import { instrumentKafka, kafkaIntegration } from './kafka';
import { instrumentKoa, koaIntegration } from './koa';
import { instrumentLruMemoizer, lruMemoizerIntegration } from './lrumemoizer';
import { instrumentMongo, mongoIntegration } from './mongo';
import { instrumentMongoose, mongooseIntegration } from './mongoose';
import { instrumentMysql, mysqlIntegration } from './mysql';
import { instrumentMysql2, mysql2Integration } from './mysql2';
import { instrumentPostgres, postgresIntegration } from './postgres';
import { prismaIntegration } from './prisma';
import { instrumentRedis, redisIntegration } from './redis';
import { instrumentTedious, tediousIntegration } from './tedious';
import { instrumentVercelAi, vercelAIIntegration } from './vercelai';
/**
* 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(),
prismaIntegration(),
hapiIntegration(),
koaIntegration(),
connectIntegration(),
tediousIntegration(),
genericPoolIntegration(),
kafkaIntegration(),
amqplibIntegration(),
lruMemoizerIntegration(),
vercelAIIntegration(),
];
}
/**
* 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 [
instrumentOtelHttp,
instrumentExpress,
instrumentExpressV5,
instrumentConnect,
instrumentFastify,
instrumentHapi,
instrumentKafka,
instrumentKoa,
instrumentLruMemoizer,
instrumentMongo,
instrumentMongoose,
instrumentMysql,
instrumentMysql2,
instrumentPostgres,
instrumentHapi,
instrumentGraphql,
instrumentRedis,
instrumentTedious,
instrumentGenericPool,
instrumentAmqplib,
instrumentVercelAi,
];
}