Skip to content

Commit

Permalink
add opentelemetry #178
Browse files Browse the repository at this point in the history
  • Loading branch information
ukorvl committed Jun 13, 2024
1 parent 626e863 commit e292832
Show file tree
Hide file tree
Showing 11 changed files with 247 additions and 95 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ jobs:
PROOFMARKET_TOOLCHAIN_REPO = "${{ secrets.PROOFMARKET_TOOLCHAIN_REPO }}"
CIRCUIT_DEVELOPER_GUIDE_URL = "${{ secrets.CIRCUIT_DEVELOPER_GUIDE_URL }}"
API_RESPONSE_WAIT_TIMEOUT = "${{ secrets.API_RESPONSE_WAIT_TIMEOUT }}"
DATADOG_APPLICATION_ID = "${{ secrets.DATADOG_APPLICATION_ID }}"
DATADOG_CLIENT_TOKEN = "${{ secrets.DATADOG_CLIENT_TOKEN }}"
DATADOG_SITE = "${{ secrets.DATADOG_SITE }}"
DATADOG_SERVICE_NAME = "${{ secrets.DATADOG_SERVICE_NAME }}"
OTEL_TRACE_EXPORTER_URL = "${{ secrets.OTEL_TRACE_EXPORTER_URL }}"
OTEL_SERVICE_NAME = "${{ secrets.OTEL_SERVICE_NAME }}"
'
echo "$config" > runtime-config.toml
echo runtime-config.toml
Expand Down
208 changes: 174 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"version": "0.1.9",
"private": true,
"dependencies": {
"@datadog/browser-rum": "^5.17.1",
"@loadable/component": "^5.15.3",
"@nilfoundation/react-components": "^0.8.3",
"@nilfoundation/ui-kit": "^2.1.3",
"@opentelemetry/exporter-trace-otlp-http": "^0.51.1",
"@opentelemetry/sdk-trace-web": "^1.24.1",
"@reduxjs/toolkit": "^1.8.5",
"baseui": "^13.0.0",
"bootstrap-sass": "^3.4.3",
Expand Down
6 changes: 2 additions & 4 deletions public/runtime-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ GA_TRACKING_ID = ""
PROOFMARKET_TOOLCHAIN_REPO = ""
CIRCUIT_DEVELOPER_GUIDE_URL = ""
API_RESPONSE_WAIT_TIMEOUT = ""
DATADOG_APPLICATION_ID = ""
DATADOG_CLIENT_TOKEN = ""
DATADOG_SITE = ""
DATADOG_SERVICE_NAME = ""
OTEL_TRACE_EXPORTER_URL = ""
OTEL_SERVICE_NAME = ""
6 changes: 5 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { useBreakpoint } from './features/shared';
import { MobileRouter } from './features/mobile';
import { NotificationContainer } from './features/notifications';
import { BREAKPOINT } from './styles/Breakpoint';
import { exportErrorToOtelCollector } from './opentelemetry';

const baseDocumentTitle = getRuntimeConfigOrThrow().SITE_DEFAULT_TITLE;

Expand All @@ -25,7 +26,10 @@ function App(): ReactElement {
const bp = useBreakpoint();

return (
<ErrorBoundary fallback={<ErrorView />}>
<ErrorBoundary
fallback={<ErrorView />}
onError={e => exportErrorToOtelCollector(e)}
>
<Helmet
titleTemplate={`${baseDocumentTitle} | %s`}
defaultTitle={baseDocumentTitle}
Expand Down
40 changes: 0 additions & 40 deletions src/datadog.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/features/routing/constants/routesConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* @copyright Yury Korotovskikh <u.korotovskiy@nil.foundation>
*/

import { lazy } from 'react';
import { Navigate } from 'react-router-dom';
import type { RouteObject } from 'react-router-dom';
import { RouterParam } from '@/enums';
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import { Provider as StyletronProvider } from 'styletron-react';
import { BaseProvider } from 'baseui';
import App from './App';
import { store } from './redux';
import { configureDatadogRUM } from './datadog';
import { initOpentelemetry } from './opentelemetry';
import { reportWebVitals } from './reportWebVitals';
import configureGA from './ga';
//import * as serviceWorkerRegistration from './serviceWorkerRegistration';
import { checkRuntimeConfig } from './utils';

checkRuntimeConfig();
configureDatadogRUM();
configureGA();
initOpentelemetry();

const engine = new Styletron();
const { theme } = createTheme(engine, { enableDefaultFonts: false });
Expand Down
Loading

0 comments on commit e292832

Please sign in to comment.