stack/apps/backend
mantrakp04 8d124a4517 feat(analytics): spans telemetry surface + event parent_span_ids
Add a generic Spans telemetry surface alongside events, written directly to
ClickHouse (spans are siblings of events, not routed through ext-db-sync).

- analytics_internal.spans table (ReplacingMergeTree, versioned) + default.spans
  view, isolated by a row policy and granted to limited_user exactly like
  default.events.
- Span types: $session-replay and $session-replay-segment (per browser tab),
  written directly from the session-replays batch route and re-written per batch
  so their end advances; $refresh-token, derived in the view from the synced
  refresh_tokens dimension.
- events.parent_span_ids: additive column holding the root-first ancestor span-id
  list ([rti, sri, srsi]), stamped on each event insert. Typed-id prefixes live
  only on span ids / parent_span_ids; scalar id columns stay raw so existing
  customer SQL keeps working (additive, backwards compatible).
- SDK: EventTracker and SessionRecorder now share one per-tab
  session_replay_segment_id (each previously minted its own, so events could not
  be correlated to a replay recording).
- Dashboard: Spans tab on the analytics tables page.
- Tests: spans unit tests + e2e for session replays, analytics events batch, and
  the analytics query surface.
2026-07-01 17:27:54 -07:00
..
prisma Keep local emulator removal in a new migration, not edits to applied ones (#1694) 2026-06-30 10:43:10 -07:00
scripts feat(analytics): spans telemetry surface + event parent_span_ids 2026-07-01 17:27:54 -07:00
src feat(analytics): spans telemetry surface + event parent_span_ids 2026-07-01 17:27:54 -07:00
.env Rename STACK_* env vars to HEXCLAVE_* in env templates, with legacy dual-read (#1588) 2026-06-19 18:58:53 -07:00
.env.development refactor: migrate config parsing from Babel AST to jiti (#1661) 2026-06-29 10:25:11 -07:00
.eslintrc.cjs refactor: migrate config parsing from Babel AST to jiti (#1661) 2026-06-29 10:25:11 -07:00
.gitignore private files n sm build shit (#1276) 2026-03-23 12:31:36 -07:00
instrumentation-client.ts feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
LICENSE Split backend and dashboard (#83) 2024-06-18 15:49:31 +02:00
next.config.mjs private files n sm build shit (#1276) 2026-03-23 12:31:36 -07:00
package.json chore: update package versions 2026-06-30 23:15:23 +00:00
prisma.config.ts Rename STACK_* env vars to HEXCLAVE_* in env templates, with legacy dual-read (#1588) 2026-06-19 18:58:53 -07:00
tsconfig.json Fix lint 2026-02-27 09:59:26 -08:00
vercel.json External db sync (#1036) 2026-02-05 12:04:31 -08:00
vitest.config.ts Rename STACK_* env vars to HEXCLAVE_* in env templates, with legacy dual-read (#1588) 2026-06-19 18:58:53 -07:00
vitest.setup.ts Customizable ports (#962) 2025-10-20 15:24:47 -07:00