Skip to content

Commit

Permalink
Merge pull request #60 from holloway-ai/dd-user-log
Browse files Browse the repository at this point in the history
inital dd
  • Loading branch information
iliatimofeev authored Jul 3, 2023
2 parents 3955768 + 02dfec8 commit b62dd89
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 26 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DD_APP_ID=9cc48266-d0ab-4371-bb2e-5dbd0fd5e79b
DD_CLIENT_TOKEN=pub9e83312bcfffa9ae8138cd96f88ce4c8
DD_SITE=datadoghq.eu
3 changes: 2 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"$tsc"
],
"label": "npm: dev",
"detail": "node dev"
"detail": "node dev",

}
]
}
55 changes: 31 additions & 24 deletions client/client-app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* global siteConfig */
/* global dd */

import { datadogRum } from '@datadog/browser-rum'

import Vue from 'vue'
import VueRouter from 'vue-router'
Expand Down Expand Up @@ -37,6 +40,10 @@ import helpers from './helpers'
// Initialize Global Vars
// ====================================

datadogRum.init(dd)
datadogRum.startSessionReplayRecording()
console.log('Datadog RUM initialized.', datadogRum)

window.WIKI = null
window.boot = boot
window.Hammer = Hammer
Expand Down Expand Up @@ -148,30 +155,30 @@ Vue.prototype.Velocity = Velocity
// Register Vue Components
// ====================================

Vue.component('admin', () => import(/* webpackChunkName: "admin" */ './components/admin.vue'))
Vue.component('comments', () => import(/* webpackChunkName: "comments" */ './components/comments.vue'))
Vue.component('editor', () => import(/* webpackPrefetch: -100, webpackChunkName: "editor" */ './components/editor.vue'))
Vue.component('history', () => import(/* webpackChunkName: "history" */ './components/history.vue'))
Vue.component('loader', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/loader.vue'))
Vue.component('login', () => import(/* webpackPrefetch: true, webpackChunkName: "login" */ './components/login.vue'))
Vue.component('nav-header', () => import(/* webpackMode: "eager" */ './components/common/nav-header.vue'))
Vue.component('new-page', () => import(/* webpackChunkName: "new-page" */ './components/new-page.vue'))
Vue.component('notify', () => import(/* webpackMode: "eager" */ './components/common/notify.vue'))
Vue.component('not-found', () => import(/* webpackChunkName: "not-found" */ './components/not-found.vue'))
Vue.component('page-selector', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/page-selector.vue'))
Vue.component('page-source', () => import(/* webpackChunkName: "source" */ './components/source.vue'))
Vue.component('profile', () => import(/* webpackChunkName: "profile" */ './components/profile.vue'))
Vue.component('register', () => import(/* webpackChunkName: "register" */ './components/register.vue'))
Vue.component('search-results', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/search-results.vue'))
Vue.component('social-sharing', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/social-sharing.vue'))
Vue.component('tags', () => import(/* webpackChunkName: "tags" */ './components/tags.vue'))
Vue.component('unauthorized', () => import(/* webpackChunkName: "unauthorized" */ './components/unauthorized.vue'))
Vue.component('v-card-chin', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/v-card-chin.vue'))
Vue.component('v-card-info', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/v-card-info.vue'))
Vue.component('welcome', () => import(/* webpackChunkName: "welcome" */ './components/welcome.vue'))

Vue.component('nav-footer', () => import(/* webpackChunkName: "theme" */ './themes/' + siteConfig.theme + '/components/nav-footer.vue'))
Vue.component('page', () => import(/* webpackChunkName: "theme" */ './themes/' + siteConfig.theme + '/components/page.vue'))
Vue.component('Admin', () => import(/* webpackChunkName: "admin" */ './components/admin.vue'))
Vue.component('Comments', () => import(/* webpackChunkName: "comments" */ './components/comments.vue'))
Vue.component('Editor', () => import(/* webpackPrefetch: -100, webpackChunkName: "editor" */ './components/editor.vue'))
Vue.component('History', () => import(/* webpackChunkName: "history" */ './components/history.vue'))
Vue.component('Loader', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/loader.vue'))
Vue.component('Login', () => import(/* webpackPrefetch: true, webpackChunkName: "login" */ './components/login.vue'))
Vue.component('NavHeader', () => import(/* webpackMode: "eager" */ './components/common/nav-header.vue'))
Vue.component('NewPage', () => import(/* webpackChunkName: "new-page" */ './components/new-page.vue'))
Vue.component('Notify', () => import(/* webpackMode: "eager" */ './components/common/notify.vue'))
Vue.component('NotFound', () => import(/* webpackChunkName: "not-found" */ './components/not-found.vue'))
Vue.component('PageSelector', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/page-selector.vue'))
Vue.component('PageSource', () => import(/* webpackChunkName: "source" */ './components/source.vue'))
Vue.component('Profile', () => import(/* webpackChunkName: "profile" */ './components/profile.vue'))
Vue.component('Register', () => import(/* webpackChunkName: "register" */ './components/register.vue'))
Vue.component('SearchResults', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/search-results.vue'))
Vue.component('SocialSharing', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/social-sharing.vue'))
Vue.component('Tags', () => import(/* webpackChunkName: "tags" */ './components/tags.vue'))
Vue.component('Unauthorized', () => import(/* webpackChunkName: "unauthorized" */ './components/unauthorized.vue'))
Vue.component('VCardChin', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/v-card-chin.vue'))
Vue.component('VCardInfo', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/v-card-info.vue'))
Vue.component('Welcome', () => import(/* webpackChunkName: "welcome" */ './components/welcome.vue'))

Vue.component('NavFooter', () => import(/* webpackChunkName: "theme" */ './themes/' + siteConfig.theme + '/components/nav-footer.vue'))
Vue.component('Page', () => import(/* webpackChunkName: "theme" */ './themes/' + siteConfig.theme + '/components/page.vue'))

let bootstrap = () => {
// ====================================
Expand Down
1 change: 1 addition & 0 deletions dev/templates/master.pug
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ html(lang=siteConfig.lang)
script.
var siteConfig = !{JSON.stringify(siteConfig)}
var siteLangs = !{JSON.stringify(langs)}
var dd = !{JSON.stringify(dd)}

//- Dev Mode Warning
if devMode
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"releaseDate": "2019-01-01T01:01:01.000Z",
"description": "A modern, lightweight and powerful wiki app built on NodeJS, Git and Markdown",
"main": "wiki.js",
"dev": false,
"dev": true,
"scripts": {
"start": "node server",
"dev": "node dev",
Expand Down Expand Up @@ -37,6 +37,7 @@
},
"dependencies": {
"@azure/storage-blob": "12.12.0",
"@datadog/browser-rum": "4.44.0",
"@exlinc/keycloak-passport": "1.0.2",
"@joplin/turndown-plugin-gfm": "1.0.45",
"@root/csr": "0.8.1",
Expand Down
14 changes: 14 additions & 0 deletions server/core/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ module.exports = {
WIKI.version = packageInfo.version
WIKI.releaseDate = packageInfo.releaseDate
WIKI.devMode = (packageInfo.dev === true)
WIKI.dd = {
applicationId: process.env.DD_APP_ID || '9cc48266-d0ab-4371-bb2e-5dbd0fd5e79b',
clientToken: process.env.DD_CLIENT_TOKEN || 'pub9e83312bcfffa9ae8138cd96f88ce4c8',
site: process.env.DD_SITE || 'datadoghq.eu',
service: process.env.DD_SERVICE || 'joan',
env: WIKI.devMode ? 'dev' : 'prod',
sessionSampleRate: 100,
sessionReplaySampleRate: 20,
trackUserInteractions: true,
trackResources: true,
trackLongTasks: true,
defaultPrivacyLevel: 'mask-user-input'
}
console.info(`DD:`, WIKI.dd)
},

/**
Expand Down
1 change: 1 addition & 0 deletions server/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ module.exports = async () => {
url: '/'
}
app.locals.devMode = WIKI.devMode
app.locals.dd = WIKI.dd

// ----------------------------------------
// HMR (Dev Mode Only)
Expand Down
20 changes: 20 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3834,6 +3834,26 @@
enabled "2.0.x"
kuler "^2.0.0"

"@datadog/browser-core@4.44.0":
version "4.44.0"
resolved "https://registry.yarnpkg.com/@datadog/browser-core/-/browser-core-4.44.0.tgz#2445395b7ddf687d68a04e631644c4ed8604f6f4"
integrity sha512-o5ApIBP2xgXyDOuYwaX5Gz4w1Wa1lRvG8j55+CTrB1t5JkCymNemTAx+GMQUfbs9Eyyd0MUVjTIk+I9FTMAjrA==

"@datadog/browser-rum-core@4.44.0":
version "4.44.0"
resolved "https://registry.yarnpkg.com/@datadog/browser-rum-core/-/browser-rum-core-4.44.0.tgz#a451f23c70db902b73c35fa85d6a595dbd7cf236"
integrity sha512-Kicw7vHGYGgN+tmVS/gk77+vk5DncsP9b4129RusOejx1YATVP2/K2tHOGL44kpEi2v2SbJYb6ix286+molRIw==
dependencies:
"@datadog/browser-core" "4.44.0"

"@datadog/browser-rum@4.44.0":
version "4.44.0"
resolved "https://registry.yarnpkg.com/@datadog/browser-rum/-/browser-rum-4.44.0.tgz#db03a7ef63f279757f7ca14efa60a4f3b2958321"
integrity sha512-uTY420AKOn9xh9wqxRvS93pk/n2mvZQSZ/E7wkzK2zBj+OBlCf4AqPrtKgn8aZ0rjVZb9+7fGLx3hsvTcFDdWA==
dependencies:
"@datadog/browser-core" "4.44.0"
"@datadog/browser-rum-core" "4.44.0"

"@eslint-community/eslint-utils@^4.3.0":
version "4.4.0"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
Expand Down

0 comments on commit b62dd89

Please sign in to comment.