Skip to content

Commit

Permalink
feat: 新しいinstrumentationモジュールを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
riya-amemiya committed Jul 6, 2024
1 parent 52bf7ea commit 378b1c5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Binary file modified bun.lockb
Binary file not shown.
22 changes: 22 additions & 0 deletions src/instrumentation copy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
const { BaselimeSDK, VercelPlugin, BetterHttpInstrumentation } =
// @ts-ignore
await import("@baselime/node-opentelemetry");

const sdk = new BaselimeSDK({
serverless: true,
service: process.env.BASELIME_SERVICE_NAME,
instrumentations: [
new BetterHttpInstrumentation({
plugins: [
// Add the Vercel plugin to enable correlation between your logs and traces for projects deployed on Vercel
new VercelPlugin(),
],
}),
],
});

sdk.start();
}
}

0 comments on commit 378b1c5

Please sign in to comment.