diff --git a/frontend/package.json b/frontend/package.json index af9d2b2..750ae84 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -23,6 +23,7 @@ "@bufbuild/buf": "^1.28.1", "@bufbuild/protobuf": "^1.5.1", "@bufbuild/protoc-gen-es": "^1.5.1", + "@datadog/browser-logs": "^5.19.0", "@fortawesome/fontawesome-free": "^6.5.1", "@melloware/coloris": "^0.23.1", "@square/svelte-store": "^1.0.17", diff --git a/frontend/src/lib/components/customview.svelte b/frontend/src/lib/components/customview.svelte index 3138b40..a51f559 100644 --- a/frontend/src/lib/components/customview.svelte +++ b/frontend/src/lib/components/customview.svelte @@ -6,7 +6,8 @@ import { asCSV } from '../stores/custom' import { findMatchesSorted } from "../utils/hdf5"; import {count, mean, sd} from '../utils/math' - + import { datadogLogs } from '@datadog/browser-logs'; + export let customModal; const { row, data, customs } = getContext('core'); @@ -116,7 +117,7 @@ const matrixName = 'Custom' const {order, sampleNames, expressionGetter, columnGetter} = $metadataProcessed.result const {index, zScores } = $metadataProcessed.result.$dataProcessed.result - return ({ + let ret = ({ [name]: { name, index, @@ -130,6 +131,8 @@ }) } }); + datadogLogs.logger.info('Adding custom dataset', {name: name, data: ret}); + return ret; } diff --git a/frontend/src/lib/stores/metadata.js b/frontend/src/lib/stores/metadata.js index 47e41be..6169384 100644 --- a/frontend/src/lib/stores/metadata.js +++ b/frontend/src/lib/stores/metadata.js @@ -1,7 +1,9 @@ import { derived } from 'svelte/store'; +import { datadogLogs } from '@datadog/browser-logs'; function createMetadataStore(core) { return derived([core.data, core.customs], ([$data, $customs]) => { + datadogLogs.logger.info('Updating metadata store', {data: $customs}); const metadataColumnReaders = {}; for(const h of $data.value.get('metadata').keys) { metadataColumnReaders[h] = { diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte index 42123fd..fde4845 100644 --- a/frontend/src/routes/+layout.svelte +++ b/frontend/src/routes/+layout.svelte @@ -6,6 +6,16 @@ import { primary, paletteColors, gradientColors } from '../lib/utils/colors' import './../../node_modules/@fortawesome/fontawesome-free/css/all.min.css'; import '../app.css'; + + import { datadogLogs } from '@datadog/browser-logs'; + datadogLogs.init({ + clientToken: 'pubb5838d5b6b4df7acca79de020e4b7dc2', + site: 'ap1.datadoghq.com', + forwardErrorsToLogs: true, + forwardConsoleLogs: "all", + sessionSampleRate: 100 + }); + const url = `${base}/metadata.json`/*'http://localhost:5501/metadata.json'*/; setContext('core', createCore(url));