From 9afb2d6427c1fae50262765cdc723f1b94c4efc2 Mon Sep 17 00:00:00 2001 From: spacehaz Date: Mon, 20 May 2024 17:32:01 +0300 Subject: [PATCH] added datadog --- package.json | 2 ++ src/index.tsx | 37 ++++++++++++++++++++++++++++++++++++- yarn.lock | 27 +++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0b34980b..dfbb5e1b 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "@auth0/auth0-react": "^2.1.1", "@coinbase/wallet-sdk": "^3.6.6", "@craco/craco": "^6.4.0", + "@datadog/browser-logs": "^5.18.0", + "@datadog/browser-rum": "^5.18.0", "@ledgerhq/connect-kit-loader": "1.1.8", "@linkdrop/contracts": "^1.2.2", "@reduxjs/toolkit": "^1.6.2", diff --git a/src/index.tsx b/src/index.tsx index 7b9b3769..e019b3b5 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -4,7 +4,15 @@ import './index.css' import App from './components/application' import reportWebVitals from './reportWebVitals' import { Auth0Provider } from '@auth0/auth0-react' -const { REACT_APP_AUTH0_DOMAIN, REACT_APP_AUTH0_CLIENT_ID } = process.env +import { datadogRum } from '@datadog/browser-rum' +import { datadogLogs } from '@datadog/browser-logs' + +const { + REACT_APP_AUTH0_DOMAIN, + REACT_APP_AUTH0_CLIENT_ID, + REACT_APP_DATADOG_CLIENT_TOKEN, + REACT_APP_DATADOG_APPLICATION_ID +} = process.env ReactDOM.render( @@ -25,3 +33,30 @@ ReactDOM.render( // to log results (for example: reportWebVitals(console.log)) // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals reportWebVitals(); + +datadogRum.init({ + applicationId: REACT_APP_DATADOG_APPLICATION_ID as string, + clientToken: REACT_APP_DATADOG_CLIENT_TOKEN as string, + // `site` refers to the Datadog site parameter of your organization + // see https://docs.datadoghq.com/getting_started/site/ + site: 'us3.datadoghq.com', + service: 'linkdrop-claim-app', + env: '', + // Specify a version number to identify the deployed version of your application in Datadog + // version: '1.0.0', + sessionSampleRate: 100, + sessionReplaySampleRate: 20, + trackUserInteractions: true, + trackResources: true, + trackLongTasks: true, + defaultPrivacyLevel: 'mask-user-input', + trackSessionAcrossSubdomains: true +}) + +datadogLogs.init({ + clientToken: 'pubb53ed516a62131623aa027c21da2a27b', + site: REACT_APP_DATADOG_CLIENT_TOKEN as string, + forwardErrorsToLogs: true, + sessionSampleRate: 100, + trackSessionAcrossSubdomains: true +}) \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 097d2590..ed8d33bc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1185,6 +1185,33 @@ resolved "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-10.1.0.tgz#f0950bba18819512d42f7197e56c518aa491cf18" integrity sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg== +"@datadog/browser-core@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@datadog/browser-core/-/browser-core-5.18.0.tgz#4f97a3f7c512210cea94285c690859b0fccc0089" + integrity sha512-ks8XGYgprzUsEpMWZXQafMSR4d5pW3eLxOZNepJHo6CgtCFzPpiclnDoQgFleKs6zoMiVL+5iveyJP7/CFxNsw== + +"@datadog/browser-logs@^5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@datadog/browser-logs/-/browser-logs-5.18.0.tgz#65124c055c1af6c1c8c97a2a6425deff3b386f53" + integrity sha512-Qy8VkmKXg6lkNLr+PyFkB9OuuZh8auQ62DqzM8cNxas0GHCVGmCn+hyBlb9Bnfwu/kNdbci6guQXCRpPnZMgsg== + dependencies: + "@datadog/browser-core" "5.18.0" + +"@datadog/browser-rum-core@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@datadog/browser-rum-core/-/browser-rum-core-5.18.0.tgz#ae0100d4cccb004f9188bd770ed4eee4ada4d257" + integrity sha512-aJuYE4KXF++ZsOaYBo9/HVk25r/5oxzK9+2hRlkINllTwtxgmXLcAjBxxaNp88w53E7d8xBVRtDEM1BWouKt2A== + dependencies: + "@datadog/browser-core" "5.18.0" + +"@datadog/browser-rum@^5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@datadog/browser-rum/-/browser-rum-5.18.0.tgz#0c11649f14070e8e7f9a12a1c1cae4bd90cdddda" + integrity sha512-D7OtvRvWnLA+Vdc/VI2vLYMKAbGZsLoI4B2ETkESOdxtxjcmaipgn1+h7jl9YJmD6ojxCBZusrRW7YaxWW1ZnA== + dependencies: + "@datadog/browser-core" "5.18.0" + "@datadog/browser-rum-core" "5.18.0" + "@emotion/babel-plugin@^11.10.6": version "11.10.6" resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.10.6.tgz#a68ee4b019d661d6f37dec4b8903255766925ead"