chore(api,services): remove Sentry integration - #1726
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📊 Test Coverage Report
|
carsonfarmer
force-pushed
the
chore/remove-sentry-api-services
branch
from
July 29, 2026 04:25
c174d4a to
8eba52d
Compare
asutula
approved these changes
Aug 7, 2026
Sentry is no longer actively monitored. Remove initialization, the Express error handler, tiered trace sampling config, the optional Drizzle query-span wrapper (and the now-unused DrizzleQueryInterceptor base class whose only consumer it was), and all capture/breadcrumb call sites in the price providers. Every removed capture site already had an adjacent structured logger call, so error visibility in logs is unchanged; processingTime context from removed captures was folded into the logger calls. The 1% raw-data sampling in the perps providers is kept - it feeds database storage, not Sentry. Also updates AGENTS.md and .cursor rules so agents no longer add Sentry instrumentation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Regenerated against main after the comps Sentry removal (#1725) merged: the lockfile diff drops the @sentry/profiling-node tree (@sentry/node itself remains for load-test until #1727), and the root turbo.json globalEnv keeps only SENTRY_DSN and SENTRY_TRACES_SAMPLE_RATE - the other Sentry vars lost their last readers with #1725 plus this PR. Verified with a frozen-lockfile install. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
carsonfarmer
enabled auto-merge (squash)
August 12, 2026 17:09
carsonfarmer
force-pushed
the
chore/remove-sentry-api-services
branch
from
August 12, 2026 17:09
8eba52d to
d3872eb
Compare
carsonfarmer
added a commit
that referenced
this pull request
Aug 12, 2026
Regenerated the lockfile against main after #1725 and #1726 merged: with load-test's @sentry/node and @sentry/tracing gone, the entire remaining @sentry tree prunes (718 deletions, no churn). The only Sentry string left in the lockfile is @sentry/core@9.46.0, a transitive dependency of hardhat's own crash reporting - not our integration. Also removes SENTRY_DSN and SENTRY_TRACES_SAMPLE_RATE from root turbo.json globalEnv; this PR deletes their last readers. Verified with a frozen-lockfile install. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
carsonfarmer
added a commit
that referenced
this pull request
Aug 12, 2026
## Summary Removes the Sentry integration from the load-testing package and its CI workflow. This is the last of the Sentry removal PRs — companions: comps (#1725) and api/services (#1726). ### Changes - Delete `src/agent-trading/utils/sentry-metrics.ts` (init, span metrics, flush, traces-link helper) - `processors/agent-trading-processor.ts`: - Remove module-load `initializeSentry()` and the Sentry-only Artillery hooks: `cleanupSentry`, `trackScenarioExecution`, `startTradeFlow`, `finishTradeFlow` - Keep `trackLoadTestMetrics` as the `afterResponse` hook — it still logs failing requests (status, agent, request/response bodies) to the console, which is what actually shows up in CI logs; only the Sentry span/message emission was removed - All 19 remaining exports verified present and loadable; every function referenced by the YAML configs exists - All four Artillery configs (`daily`, `resilience`, `stress`, `tge`): remove references to the deleted hooks (including the `after:` blocks that only flushed Sentry); all four verified to still parse as valid YAML - `cli.ts`: remove `--traces-sample-rate` / `--request-sample-rate` flags, Sentry env plumbing, and the post-run "View results in Sentry" traces link - `report-analyzer.ts`: reword recommendations that pointed at Sentry dashboards to point at application logs - Drop `@sentry/node` and `@sentry/tracing` deps (`@sentry/tracing` was declared but **never imported anywhere** — pure dead weight) - Remove the 5 `SENTRY_*` env declarations from `packages/load-test/turbo.json` and the `.env.example` block; update README and AGENTS.md - `.github/workflows/load-testing.yml`: stop injecting `secrets.SENTRY_DSN` into the test env ### Verification - `pnpm --filter @recallnet/load-test lint` ✅ - All four Artillery YAML configs parse ✅ - `npx tsx src/cli.ts --help` runs; processor module loads with all YAML-referenced functions present ✅ - Full pre-push hook (monorepo `pnpm lint && pnpm format:check && pnpm build`) ✅ ### Note on merge order Recommended merge order for the three Sentry PRs: #1725 → #1726 → this one, rebasing each after the previous merges (`pnpm-lock.yaml` conflicts resolve with `pnpm install`). Order isn't strictly required — each PR is self-contained — but this order keeps rebases trivial. ##⚠️ Required human actions (not performed by this PR) This PR intentionally touches **code only**: 1. **GitHub repository settings**: delete the `SENTRY_DSN` Actions secret (Settings → Secrets and variables → Actions). It's unreferenced after this merges. 2. **Sentry (recallnet org)**: archive/delete the load-testing project (the one `SENTRY_PROJECT_ID` pointed at). 3. **Final repo tidy-up (after all three Sentry PRs merge)**: a handful of `SENTRY_*` entries remain in the root `turbo.json` `globalEnv` list (each PR could only remove the vars whose last code reader it deleted, or lint would fail on the still-present code from the other PRs). Once all three are merged, the leftovers (`SENTRY_DSN`, `SENTRY_ENVIRONMENT`, `SENTRY_TRACES_SAMPLE_RATE`, `SENTRY_CRITICAL_SAMPLE_RATE`, `SENTRY_API_SAMPLE_RATE`) are unreferenced and can be deleted in a one-line follow-up. They're inert in the meantime. 4. **Cancel the Sentry subscription** for the `recallnet` org once all three PRs are deployed and the projects are archived. Consider exporting/archiving any issue history first if anyone wants it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the Sentry integration from the API server and the services package (part of winding down Sentry since we no longer actively monitor it). Companion PRs: comps removal (#1725) and load-test removal (to follow).
Changes —
apps/apisrc/index.ts(startup init, profiling option,expressErrorHandlermiddleware — the customerrorHandlerremains)lib/sentry.ts,lib/sentry-config.ts(tiered trace sampling: 10% trade/admin, 1% default, 0% health checks),types/sentry.tsdatabase/sentry-wrapper.ts(opt-in Drizzle query-span wrapper behindENABLE_SENTRY_DB_MONITORING) and unwrapdb/dbReadindatabase/db.tslib/performance/drizzle-query-interceptor.ts— its doc comment says it's shared with a performance profiler, but the Sentry wrapper was its only consumer in the tree, so it becomes dead code@sentry/node+@sentry/profiling-nodedeps; remove Sentry env vars fromapps/api/turbo.jsonand.env.exampleturbo.json(ENABLE_SENTRY_PROFILING,SENTRY_PROFILE_SAMPLE_RATE,SENTRY_DATABASE_SAMPLE_RATE,ENABLE_SENTRY_DB_MONITORING). Vars still read by comps/load-test code onmainare intentionally left; the load-test PR does the final sweep.Changes —
packages/servicescaptureException,captureMessage) across the four price providers (rpc-spot,alchemy-rpc,hyperliquid-perps,symphony-perps)this.loggercall with the same context; theprocessingTimefield that only the Sentry captures carried was folded into those logger callsrawDatafor database storage, which is independent of Sentry (only the "also send a sample to Sentry" part was removed)logger.warn(only the extra Sentry message was dropped)@sentry/nodemocks from the three provider test files; drop the@sentry/nodedepDocs / agent guidance
AGENTS.md: drop the "Sentry is configured…" bullet.cursor/rules/api-specific-config.mdc: remove the Error Tracking & APM (Sentry) section — it explicitly instructed AI agents to addSentry.addBreadcrumb()/captureException()when integrating external APIs, which would have caused Sentry usage to creep back inTrade-off to be aware of
API errors are no longer aggregated in Sentry — visibility is via structured pino logs and the existing Prometheus metrics on port 3003 (alerting is already handled externally per AGENTS.md, so the alerting path is unchanged).
Verification
pnpm turbo build --filter=api --filter=@recallnet/services✅pnpm --filter api lint && pnpm --filter @recallnet/services lint✅pnpm --filter @recallnet/services test— 108 files, 2,147 tests passed ✅pnpm lint && pnpm format:check && pnpm build) ✅The API already boots without Sentry env vars (it logged "Sentry DSN not configured, skipping initialization"), so this PR is safe to deploy in any order relative to the env cleanup below.
This PR intentionally touches code only:
SENTRY_DSN,SENTRY_ENVIRONMENT,ENABLE_SENTRY_DB_MONITORING,ENABLE_SENTRY_PROFILING,SENTRY_TRACES_SAMPLE_RATE,SENTRY_CRITICAL_SAMPLE_RATE,SENTRY_API_SAMPLE_RATE,SENTRY_DATABASE_SAMPLE_RATE,SENTRY_PROFILE_SAMPLE_RATE.recallnetorg.🤖 Generated with Claude Code