MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / register

Function register

packages/web/src/instrumentation.ts:5–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { LangfuseExporter } from 'langfuse-vercel';
4
5export async function register() {
6 if (
7 process.env.LANGFUSE_SECRET_KEY &&
8 process.env.NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY
9 ) {
10 console.log("Registering Langfuse");
11 registerOTel({
12 serviceName: 'sourcebot',
13 traceExporter: new LangfuseExporter({
14 secretKey: process.env.LANGFUSE_SECRET_KEY,
15 publicKey: process.env.NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY,
16 baseUrl: process.env.NEXT_PUBLIC_LANGFUSE_BASE_URL,
17 }),
18 });
19 }
20
21 if (process.env.NEXT_RUNTIME === 'nodejs') {
22 await import('../sentry.server.config');
23 }
24
25 if (process.env.NEXT_RUNTIME === 'edge') {
26 await import('../sentry.edge.config');
27 }
28
29 if (process.env.NEXT_RUNTIME === 'nodejs') {
30 await import('./initialize');
31 }
32}
33
34export const onRequestError = Sentry.captureRequestError;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected