Temporarily disable legacy checker flow + add Sentry observability#213
Merged
Temporarily disable legacy checker flow + add Sentry observability#213
Conversation
Returns 503 with a temporarily_disabled JSON body while we investigate the web dyno memory leak. Captures every hit via Sentry.capture_message with caller IP, user-agent, referer, and the small name/version params so we can identify what is hitting this endpoint after the Heroku Scheduler entry for Compats::CheckUnchecked is removed. Wraps the existing controller spec with xdescribe and a comment so the suite stays green; re-enable after restoring endpoint behavior.
Returns 503 with a temporarily_disabled JSON body. Sentry capture extracts only action, conclusion, branch (small fields) plus IP, user-agent, referer; intentionally does NOT capture the raw request body to avoid the same logging-allocation pattern that contributed to the lockfile-content RSS jumps measured on Apr 30. Wraps the controller spec with xdescribe so the suite stays green.
Tail end of the legacy GH-Actions checker flow. Once the Heroku Scheduler entry for Compats::CheckUnchecked is removed and no new workflows are dispatched, this endpoint should see zero traffic. Sentry capture lets us confirm that and identify any unexpected caller. Returns 503. Wraps the controller spec with xdescribe so the suite stays green.
Removes the 'Check a gem' nav link and homepage entry point when the new lockfile-based flow is enabled, leaving only the lockfile submission path visible. The backend routes still exist; they are covered by the legacy-page Sentry tracking added separately.
Sentry.capture_message is called from the four remaining legacy entry points so we can identify who is still hitting them after the UI is hidden: - POST /gems (gemmies#create) full sample - GET /gems/compat_table full sample (low expected volume after homepage stops calling it) - GET /gems/:id (gemmies#show) 1% sample (heavy crawler traffic) - GET /gems/:gemmy_id/compatibility/:id 1% sample (heavy crawler traffic) Sampled paths use rand < 0.01 to stay within Sentry free-tier event quota; the captured payload includes IP, user-agent, referer and the small path parameters.
traces_sample_rate=0.05 turns on per-transaction performance traces in the Sentry UI; profiles_sample_rate=0.05 adds allocation flame graphs on the same sampled requests. Together they give us per-endpoint latency and allocation hot spots without manual instrumentation, while staying well under the free-tier event quota at the app's current traffic level.
The previous commit dropped before_action :authenticate_api_key! when swapping the controller body for the temporarily_disabled response. Restoring it so only authorized callers reach the Sentry capture path and bots/scanners get a clean 401 without burning Sentry quota. sanitize_result_params! is intentionally left out: we never read the result body anymore, so there is nothing to sanitize.
JuanVqz
commented
May 4, 2026
| config.release = Rails.configuration.revision | ||
| config.send_default_pii = true | ||
| config.traces_sample_rate = 0.05 | ||
| config.profiles_sample_rate = 0.05 |
Member
Author
There was a problem hiding this comment.
traces_sample_rate=0.05 turns on per-transaction performance traces in
the Sentry UI; profiles_sample_rate=0.05 adds allocation flame graphs
on the same sampled requests. Together they give us per-endpoint
latency and allocation hot spots without manual instrumentation, while
staying well under the free-tier event quota at the app's current
traffic level.
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
Temporarily disable the legacy GH-Actions checker flow at the API edge so we can isolate whether the new lockfile flow is the source of the production memory leak. Adds Sentry tracking on every disabled endpoint and on the remaining legacy gem pages so we can identify any caller.
Background
PRs #199, #200, #203 and railsbump/checker#40 reduced the leak meaningfully but did not close it. Heroku metrics for the most recent weekend show AVG 873 MB / MAX 1335 MB on web.1 against a 1024 MB quota, with R14 errors firing repeatedly.
On Apr 30 we measured a clean +14 MB step on web.1 RSS for each
POST /lockfilesupload that did not reclaim, while quiet windows of pure crawler traffic stayed flat. That points the next investigation at the new lockfile flow.To make that investigation clean, this PR removes the legacy flow as a confound. The legacy chain runs through:
POST /api/releases→RailsReleases::Create.perform_async/Gemmies::Process.perform_asyncPOST /api/github_notifications→GithubNotification.create!+GithubNotifications::Process.perform_asyncPOST /api/results→ tail of the GH Actions check pipelinebin/rails runner "Compats::CheckUnchecked.call"every 10 min (must be disabled separately in the Heroku UI; no CLI for that)After this PR plus the scheduler removal, the only flow producing checker work is
Lockfile#run_check!onPOST /lockfiles.Manual steps required after merge
What this PR is not
Not a fix. The leak measurement points at the lockfile flow; this PR only removes the legacy flow as a possible confound and gives us observability on what is still calling those endpoints. The leak hunt continues in a follow-up PR (planned: per-request memory delta middleware to attribute RSS retention to a specific path).
Test plan
temporarily_disabledmessages over 24h to identify callers.Related
:outputpersistence, jemalloc Procfile wrap):outputnotes/memory-leak-watch.md— full data trail across the investigation