Repository navigation
refactor(sentry): take sentry-ruby/sentry-rails 7.0.0 without changing behaviour - #242
Merged
Merged
Conversation
Bumps [sentry-rails](https://github.com/getsentry/sentry-ruby) from 6.7.0 to 7.0.0. - [Release notes](https://github.com/getsentry/sentry-ruby/releases) - [Changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md) - [Commits](getsentry/sentry-ruby@6.7.0...7.0.0) Signed-off-by: Artem Petrov <[email protected]> --- updated-dependencies: - dependency-name: sentry-rails dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
sentry-ruby 7.0.0 removes `enable_logs`, which the initializer set, so the gem bump alone dies at boot with `undefined method 'enable_logs=' for an instance of Sentry::Configuration` — the image build fails at assets:precompile. Dropping the line is not enough. Under 6.7 `rails.structured_logging.enabled` was derived from `enable_logs` in an `after(:configured)` hook, so a `rails console` session shipped no Rails log subscribers; 7.0 defaults it to true unconditionally. Set it explicitly to the value 6.7 derived. Logs themselves need no replacement gate: the `:logger` patch that turns this app's ::Logger output into Sentry log events is still opt-in through `enabled_patches`, and a console session still gets none. Metrics were already on (6.7 defaulted `enable_metrics` to true), and `config.otlp.*` flipping to false is inert without sentry-opentelemetry, which this app does not install. Also drops the unrelated json 2.21.2 -> 3.0.2 rider dependabot resolved in; nothing in the tree asks for more than `json >= 2.3`. `send_default_pii = true` stays for now — 7.0 backfills `data_collection` from it, so behaviour is unchanged. Migrating to explicit `data_collection` is its own task before 8.0 removes the flag. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
This was referenced Sep 11, 2026
artempartos
added a commit
that referenced
this pull request
Sep 12, 2026
…253) sentry-ruby 7.0.0 removed `enable_logs`, and #242 migrated config/initializers/sentry.rb for it — but bin/temporal_worker calls Sentry.init a second time, with its own DSN, after config/environment. That call kept the flag, so the worker raised NoMethodError from inside Sentry.init and died on boot. Nothing but the initializer is loaded by `assets:precompile`, so the image built green and the failure only appeared in the cluster: every worker-ruby pod hit CrashLoopBackOff, no one polled the Temporal task queue, and every WorkflowRun created afterwards sat in `pending` indefinitely — which reads on screen as sessions waiting on a concurrency limit that is nowhere near full. No behaviour to preserve: under 7.0 logs are unconditionally on, and this init sets no enabled_patches, so the `:logger` patch that would turn the worker's own log output into Sentry log events stays off. Signed-off-by: Artem Petrov <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
Takes
sentry-ruby/sentry-rails6.7.0 → 7.0.0 with no change in what this app sendsto Sentry. Supersedes #229 and #230, both of which were red.
Why the bare bump fails
config/initializers/sentry.rbsetconfig.enable_logs, which 7.0.0 removed. Both dependabotPRs died in the image build at
assets:precompile:Backend and frontend checks fail together because they share that build.
What each 7.0 breaking change means here
enable_logsremoved, Logs on by default. No replacement gate is needed. The only thingthat turns this app's
::Loggeroutput into Sentry log events is the:loggerpatch, and thatis still opt-in through
enabled_patches(register_patch(:logger)just lost its internalif config.enable_logs). A console session keepsenabled_patches = [], so it still emitsnothing. Nothing in
app/,lib/orconfig/callsSentry.loggerdirectly.Rails structured logging — the one that actually changes. Under 6.7,
sentry-rails/configuration.rbhad:so it followed
enable_logsand was off in a console. 7.0 deletes that hook and defaults@enabledtotrue, which would start shipping ActiveRecord + ActionController logsubscribers from
rails consoletoo. Set explicitly to!running_console— exactly the value6.7 derived.
enable_metricsremoved, Metrics on by default. No change: 6.7.0 already defaultedenable_metricstotrue(configuration.rb:582) and this app never set it.config.otlp.setup_otlp_traces_exporter/setup_propagatordefault to false. Inert —otlpis asentry-opentelemetryoption and that gem is not in the Gemfile.send_default_piideprecated. Left attrueon purpose.send_default_pii=callsDataCollection.backfill(self), which for a truthy value returns the permissive defaults —i.e. 7.0 reproduces the old behaviour by construction. Hand-transcribing thirteen
data_collection.*fields for zero behavioural change is how you introduce a difference, nothow you avoid one. It costs one deprecation line at boot, and the real migration belongs in its
own PR before 8.0 removes the flag.
One deliberate small difference comes free with 7.0 and is kept: its new
after(:configured)hook folds
Rails.application.config.filter_parametersintodata_collection.url_query_params, so query strings are filtered where 6.7 sent them whole.That is strictly less PII leaving the app.
Also in this PR
Dropped the unrelated
json2.21.2 → 3.0.2 major that #230 resolved in as a rider.sentry-ruby7.0.0 does not depend onjsonat all, and the strictest constraint anywhere inGemfile.lockisjson (>= 2.3), so 2.21.2 still satisfies the graph. A json major deservesits own PR.
Verification
CI is the check that matters here: the failure mode is a boot-time
NoMethodErrorduringassets:precompile, which the image build in both check jobs exercises before a single testruns.
🤖 Generated with Claude Code