-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtelemStart.ts
More file actions
22 lines (19 loc) · 788 Bytes
/
telemStart.ts
File metadata and controls
22 lines (19 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto";
import { NodeSDK } from "@opentelemetry/sdk-node";
// import { ConsoleSpanExporter } from "@opentelemetry/sdk-trace-base";
import { PrismaInstrumentation } from "@prisma/instrumentation";
const traceExporter = new OTLPTraceExporter();
// const traceExporter = new ConsoleSpanExporter();
const sdk = new NodeSDK({
traceExporter,
instrumentations: [
getNodeAutoInstrumentations(),
new PrismaInstrumentation(),
],
});
// eslint-disable-next-line @typescript-eslint/no-floating-promises
sdk.start().then(() => {
// eslint-disable-next-line no-console
console.log(`✅ OTLP ready`);
});