Skip to content

docs: Sentry to @nais/apm migration guide#877

Merged
Starefossen merged 1 commit into
mainfrom
docs/sentry-migration-guide
Jul 6, 2026
Merged

docs: Sentry to @nais/apm migration guide#877
Starefossen merged 1 commit into
mainfrom
docs/sentry-migration-guide

Conversation

@Starefossen

Copy link
Copy Markdown
Member

What

Adds a new nav-gated how-to: Migrate from Sentry to @nais/apm
(docs/observability/frontend/how-to/migrate-from-sentry.md).

This is a clean, full-migration guide — teams move off @sentry/* entirely
onto idiomatic @nais/apm. It is explicitly not a compatibility-shim guide.

Contents

  • Who this is for — teams on Sentry (often already on Faro too); end state is Sentry fully removed.
  • Concept map — Sentry API/config → @nais/apm equivalent (init, captureException/captureMessage, setUser/setTag/setContext, ApmErrorBoundary/withApmErrorBoundary, route tracking, tracing, replay, sourcemap upload → server-side CDN, alerts → Grafana, Issues tab).
  • Step-by-step recipe — copy-pasteable, with real navikt before/after shapes (Vite initSentry.ts, Next.js instrumentation-client.ts + withSentryConfig).
  • What's different (honesty section) — no event id, setUser PII drop (personvern), Grafana Issues tab triage model, server-side sourcemaps, Grafana alerts, events-tier replay default, and a plainly-stated not-yet-supported table.
  • Migration checklist.

Flagged as not-yet-supported in the SDK

addBreadcrumb/beforeBreadcrumb, manual spans/transactions (startSpan/startTransaction), scopes (withScope/configureScope), setExtra/plural setters, lastEventId(), showReportDialog, profiling/release-health/attachments, and React Router v5/v7 + data routers.

Notes

  • Nav-gated via conditional: [tenant, nav] frontmatter.
  • Grounded in the SDK's own Sentry-parity JSDoc (api.ts, index.ts, react/*, feedback.ts) and real navikt Sentry usage.
  • Build verified green for nav + ssb; page renders for nav, is stripped for ssb, no leftover template tokens; tenant_url macro and internal links resolve.

Draft — to be refined with usage-research findings.

…+ quickstarts

Centralize the PII/setUser rule and the Sentry-differences list on the
`@nais/apm` API reference so guides cross-link instead of duplicating.

- reference: rename "Known limitations (0.1.0)" to a version-free
  "Limitations & differences from Sentry" and make it the complete list
  (no event id, setTag-as-context, unsupported Sentry APIs, no source-map
  upload, preview replay). Expand "Privacy: PII scrubbing" with a canonical
  "setUser and user identity" section. Give InitOptions a real anchor.
- migration guide: replace the long "What's different" / "Not yet supported"
  sections with a short "Differences from Sentry" that cross-links the
  reference; reduce Issues/Alerts/source-maps to one-liners with links.
- quickstarts (Next.js, React+Vite): replace the repeated opaque-id/PII and
  server-side source-map explanations with one-liner cross-links; keep the
  framework-specific setup.
- fix stale cross-link anchors into the reference (init options, captureException).
- pin docs to @nais/apm@0.4.0.
@Starefossen Starefossen force-pushed the docs/sentry-migration-guide branch from 2337143 to ef7512c Compare July 6, 2026 07:21
@Starefossen Starefossen merged commit 97da2f4 into main Jul 6, 2026
5 checks passed
@Starefossen Starefossen deleted the docs/sentry-migration-guide branch July 6, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant