Skip to content

Commit

Permalink
Add APM tracing into next.js APIs (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoMogg authored Aug 22, 2024
1 parent c84d2ca commit 1db1545
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions apps/web/app/datadog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
'use client';

import { datadogRum } from '@datadog/browser-rum';
import { datadogLogs } from '@datadog/browser-logs';
import { isDevelopment } from 'apps/web/src/constants';
import { useEffect } from 'react';

Expand Down Expand Up @@ -32,15 +31,12 @@ export default function DatadogInit() {
trackResources: true,
trackLongTasks: true,
defaultPrivacyLevel: 'mask',
});
datadogLogs.init({
clientToken: process.env.nextPublicDatadogClientToken as string,
env: process.env.NODE_ENV as string,
site: 'datadoghq.com',
forwardConsoleLogs: ['error', 'info'],
forwardErrorsToLogs: true,
sessionSampleRate: 100,
service: 'base-org',
allowedTracingUrls: [
{
match: (url: string) => url.startsWith('https://base.org/api'),
propagatorTypes: ['datadog'],
},
],
});
}, []);

Expand Down

0 comments on commit 1db1545

Please sign in to comment.