/
githubmirror
/
tldraw
Обзор
Документация
Войти
/
githubmirror
/
tldraw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
apps/dotcom/sync-worker/src/utils/analytics.ts
34 строки
1 KB
alex
pg connect logs (#6708)
08 сен 2025, 14:30
Не верифицирован
08 сен 2025, 14:30
f314808
Код
Авторство
О чём код?
import { createSentry } from '@tldraw/worker-shared' import { Analytics, Environment } from '../types' export interface EventData { blobs?: string[] indexes?: [string] doubles?: number[] } export function writeDataPoint( sentry: ReturnType<typeof createSentry> | undefined, measure: Analytics | undefined, env: Environment, name: string, { blobs, indexes, doubles }: EventData ) { try { measure?.writeDataPoint({ // We put the worker name in the second spot for legacy reasons: when we first introduced analytics // we only included the name. If we were to change the order it would be hard to query old data. blobs: [name, env.WORKER_NAME ?? 'development-tldraw-multiplayer', ...(blobs ?? [])], doubles, indexes, }) } catch (_e) { // // eslint-disable-next-line @typescript-eslint/no-deprecated // sentry?.withScope((scope) => { // scope.setExtra('name', name) // // eslint-disable-next-line @typescript-eslint/no-deprecated // sentry.captureException(e) // }) // console.error('Failed to write data point', e) } }