remove-sentry
Skill316 starsChanged 5 months agoMITView on GitHub
Completely remove Sentry from this monorepo — both the Next.js UI (@sentry/nextjs) and Strapi (@strapi/plugin-sentry) — while keeping pino structured logging (@repo/logging) intact. Use whenever the user wants to drop Sentry, remove error tracking, stop using @sentry/nextjs, delete the Sentry provider/integration, or clean Sentry out of the starter. The logger (logger/logError/withSpan) and all its call sites must stay working.
- Reads credentials
- Installs packages
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-content-typeSkill
- add-localeSkill
- add-ui-componentSkill
- consolidate-patternsSkill
- copy-componentSkill
- create-content-componentSkill
- find-componentSkill
- find-skillsSkill
- frontend-designSkill
- make-prSkill
- next-best-practicesSkill
- remove-azure-monitorSkill
- remove-cache-revalidationSkill
- remove-cdn-purgeSkill
- resolve-review-suggestionsSkill
- review-prSkill
- seed-contentSkill
- start-workSkill
- strapi-schema-checkSkill
- validate-branch-refsSkill
- vercel-react-best-practicesSkill
- write-testsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Remove Sentry entirely from both apps without touching pino logging.
- Very specific: line 39
If the user also wants Azure Monitor gone, that is the separate remove-azure-monitor skill.
- Distinctive: line 117
Run these and confirm they pass (Node engine warnings are expected and harmless):
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Remove Sentry
Remove Sentry entirely from both apps without touching pino logging. After
this skill runs, @repo/logging and every logger / logError / withSpan
call site still works exactly as before — only Sentry (the error-tracking
backend) is gone.
Why this is safe
Sentry is wired as one pluggable telemetry provider plus a few framework hooks; it is independent of the structured-logging core. The logger ships logs to stdout (and, if configured, Azure Monitor) regardless of Sentry. So removing Sentry is a self-contained subtraction.
Guardrails — do NOT remove these
These belong to logging, not Sentry. Leave them untouched:
packages/logging/**(pino,@opentelemetry/api,createLogging,logError,withSpan).apps/ui/src/lib/logging.ts,apps/strapi/src/utils/logging.ts(the app wrappers).apps/ui/src/lib/telemetry/providers/azure-monitor.ts,apps/strapi/src/telemetry/providers/azure-monitor.tsand theazureMonitorProvider()registry entries.- Any
logger.*/logError(...)/withSpan(...)call site. apps/strapi/config/logger.ts(Strapi's@strapi/loggerformatting — unrelated to@strapi/plugin-sentry).
If the user also wants Azure Monitor gone, that is the separate
remove-azure-monitor skill.
Procedure
Work top-down. After the known edits, run the discovery grep to catch anything
left. If --dry-run is passed, report the planned changes instead of editing.
1. UI — telemetry provider
- Delete
apps/ui/src/lib/telemetry/providers/sentry.ts. - In
apps/ui/src/lib/telemetry/index.ts: remove theimport { sentryProvider } from "./providers/sentry"line and thesentryProvider()entry from the providers array. (LeaveazureMonitorProvider()if present. If the array ends up empty, keep the registry — it stays a valid no-op scaffold.)
2. UI — browser SDK + instrumentation
- Delete
apps/ui/sentry.client.config.ts. - In
apps/ui/src/instrumentation.ts: removeimport * as Sentry from "@sentry/nextjs"and theexport const onRequestError = Sentry.captureRequestErrorline. Keep theregister()function and itsinitializeTelemetry(runtime)call.
3. UI — error boundaries
Sentry.captureException(error) is called in two client components. Remove the
Sentry import and replace the capture call with console.error(error) so errors
stay visible in the browser console (these are client components — console is
correct there, see the Observability doc's runtime boundaries):
apps/ui/src/app/[locale]/error.tsxapps/ui/src/components/elementary/ErrorBoundary.tsx
4. UI — next.config
In apps/ui/next.config.mjs:
- Remove
import { withSentryConfig } from "@sentry/nextjs". Replace the
withConfigIIFE that wrapswithSentryConfig(...)with a direct export of the intl-wrapped config:export default withNextIntl(nextConfig)(Delete the whole
const withConfig = (() => { ... })()block and theexport default withConfig.)- Sentry is not in
serverExternalPackages; leavepino,pino-pretty, and@azure/monitor-opentelemetrythere.
5. UI — env + deps
apps/ui/src/env.mjs: removeNEXT_PUBLIC_SENTRY_DSN(client), andSENTRY_AUTH_TOKEN,SENTRY_ORG,SENTRY_PROJECT,SENTRY_SUPPRESS_GLOBAL_ERROR_HANDLER_FILE_WARNING(server) — from both the schema blocks and theruntimeEnvblock.apps/ui/package.json: remove the@sentry/nextjsdependency.apps/ui/.env.local.example: remove the Sentry settings section. Keep the Observability section.
6. Strapi
apps/strapi/config/plugins.ts: remove thesentry: { ... }plugin block.apps/strapi/package.json: remove the@strapi/plugin-sentrydependency.apps/strapi/.env.example: remove the# ------- Sentry -------section andSENTRY_DSN. Keep the Observability section.
7. Shared config
turbo.jsonglobalEnv: removeSENTRY_AUTH_TOKEN,SENTRY_ORG,SENTRY_PROJECT,SENTRY_SUPPRESS_GLOBAL_ERROR_HANDLER_FILE_WARNING.
8. Docs
apps/docs/docs/reference/integrations/logging.md: delete the entire## Sentrysection (including the### Next.js UIand### Strapisubsections). In the## Runtime boundariessection, drop the "browser errors are covered by Sentry" clause. Update the intro line that lists bundled providers so it no longer names Sentry.apps/docs/docs/reference/packages/logging.md: in "Related Documentation", change "(Azure Monitor, Sentry)" to drop Sentry.- Fix cross-references that point at
logging.md#sentryor describe Sentry — search and update:apps/docs/docs/ui/next-config.md,apps/docs/docs/ui/error-handling.md,apps/docs/docs/getting-started/features.md,apps/docs/docs/strapi/environment-variables.md(also drop theSENTRY_DSNtable row),apps/docs/docs/strapi/plugins/overview.md(drop the Sentry row).
9. Reinstall + discovery sweep
pnpm install
# Catch anything missed (ignore node_modules / build output):
grep -rin "sentry" apps packages turbo.json .env* --include="*.ts" --include="*.tsx" --include="*.mjs" --include="*.json" --include="*.md" 2>/dev/null | grep -v node_modulesResolve every remaining hit. Some are legitimate to delete (configs, deps), others are docs prose to reword.
Verify
Run these and confirm they pass (Node engine warnings are expected and harmless):
pnpm -F @repo/ui exec tsc --noEmit
pnpm -F @repo/strapi exec tsc --noEmit -p tsconfig.json
pnpm -F @repo/ui build # confirms next.config no longer needs withSentryConfig
pnpm -F @repo/ui test
pnpm -F @repo/strapi test
pnpm -F @repo/docs build # fails on broken links — confirms no dangling Sentry refsSanity-check that logging still works: a grep -rn "logError\|logger\." apps/ui/src apps/strapi/src should still show the call sites, and @repo/logging should be unchanged.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

