add baselime to nextjs
This commit is contained in:
committed by
Carl-Gerhard Lindesvärd
parent
ac84adf1a4
commit
dd53a5757a
@@ -30,6 +30,7 @@ const config = {
|
||||
experimental: {
|
||||
// Avoid "Critical dependency: the request of a dependency is an expression"
|
||||
serverComponentsExternalPackages: ['bullmq', 'ioredis'],
|
||||
instrumentationHook: true,
|
||||
},
|
||||
/**
|
||||
* If you are using `appDir` then you must comment the below `i18n` config out.
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"with-env": "dotenv -e ../../.env -c --"
|
||||
},
|
||||
"dependencies": {
|
||||
"@baselime/node-opentelemetry": "^0.5.8",
|
||||
"@clerk/nextjs": "^4.29.7",
|
||||
"@clickhouse/client": "^0.2.9",
|
||||
"@hookform/resolvers": "^3.3.4",
|
||||
|
||||
21
apps/dashboard/src/instrumentation.ts
Normal file
21
apps/dashboard/src/instrumentation.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/* eslint-disable */
|
||||
|
||||
export async function register() {
|
||||
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
||||
const { BaselimeSDK, VercelPlugin, BetterHttpInstrumentation } =
|
||||
// @ts-expect-error
|
||||
await import('@baselime/node-opentelemetry');
|
||||
|
||||
const sdk = new BaselimeSDK({
|
||||
serverless: true,
|
||||
service: 'vercel-coderaxs-projects-d46dc62b',
|
||||
instrumentations: [
|
||||
new BetterHttpInstrumentation({
|
||||
plugins: [new VercelPlugin()],
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
sdk.start();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user