Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
922c916
feat(rails): add messaging span data to ActiveJob consumer transaction
solnic May 7, 2026
8377b4d
feat(rails): emit producer span when enqueueing ActiveJob
solnic May 7, 2026
06b0c59
feat(rails): propagate trace context through ActiveJob payload
solnic May 7, 2026
3a94587
fixup(rails): account for AJ producer span in active_storage subscrib…
solnic May 7, 2026
f2f533d
feat(active_job): propagate allowed user context
solnic May 7, 2026
64dc093
feat(rails): isolate Sentry hub per worker thread for ActiveJob
solnic May 7, 2026
ceb9dfa
refactor(rails): bundle ActiveJob tracing examples into a distributed…
solnic May 7, 2026
4ec31a8
fixup(rails): widen latency tolerance on Rails < 7 in messaging_span_…
solnic May 7, 2026
97ff8bb
refactor(rails): introduce worker_thread harness hook for the hub-iso…
solnic May 7, 2026
602131a
fix(rails): no with_usec in 7.0
solnic May 8, 2026
e613c15
chore(rails): patch AJ test adapter for 5.2
solnic May 12, 2026
880b110
fix(active_job): always emit retry count on the consumer transaction
solnic May 12, 2026
9ba0abf
feat(active_job): add active_job_propagate_traces config option
solnic May 12, 2026
b779841
feat(active_job): set scope tags and context on consumer like Sidekiq
solnic May 12, 2026
6ca797b
fix(active_job): avoid shared queue race in jruby
solnic May 12, 2026
2aeaed6
fix(active_job): save and restore hub around job execution
solnic May 12, 2026
05733e9
fix(active_job): better specs for thread isolation
solnic May 12, 2026
f492200
fix(active_job): correct retry counter
solnic May 12, 2026
5ab3853
fix(active_job): widen manual flushing to rails < 6.1
solnic May 20, 2026
92daaad
refactor(active_job): make the spec harness adapter-agnostic
solnic May 20, 2026
4be580d
test(active_job): verify the AJ tracing suite passes on the :sidekiq …
solnic May 20, 2026
e2b9d26
test(e2e): end-to-end ActiveJob distributed-tracing spec
solnic May 20, 2026
c106265
perf(active_job): boot the dummy app once per spec group
solnic May 21, 2026
53be2f4
tests(active_job): add basic scenario for active_job_propagate_traces
solnic May 22, 2026
4261fff
refa(active_job): log more details when adding sentry payload fails
solnic May 22, 2026
229954d
refa(active_job): store our stuff under single _sentry ivar
solnic May 22, 2026
89ea6c0
refa(active_job): better thread isolation spec
solnic May 25, 2026
5c0950f
tests(active_job): request-based hub isolation coverage
solnic May 25, 2026
a449016
fix(active_job): calc latency to reduce flakiness
solnic May 25, 2026
9de07e2
feat(rails): add dj/resque adapter specs
solnic May 29, 2026
0c26226
refactor(active_job): ensure enqueue won't crash due to sentry crashing
solnic Jun 15, 2026
32d7322
fix(active_job): symbolize user keys for proper scope handling
solnic Jun 15, 2026
f4e8218
tests(rails): ensure our instrumentation failures do not break AJ bac…
solnic Jun 16, 2026
18883c7
tests(rails): ensure queue.publish is emitted regardless of propagate…
solnic Jun 16, 2026
5f6927b
refactor(rails): remove dead defaulting to {} for user
solnic Jun 16, 2026
d257a54
refactor(rails): use consumer_transaction helper
solnic Jun 16, 2026
3401d19
fix(rails): relax spying to make the spec pass under old rails
solnic Jun 16, 2026
310f7d2
fix(active_job): use background: true like integration gems
solnic Jun 25, 2026
036a44d
chore(deps): bump lockfiles
solnic Jun 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .devcontainer/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@ SENTRY_E2E_SVELTE_APP_PORT=4001
SENTRY_E2E_RAILS_APP_URL="http://localhost:4000"
SENTRY_E2E_SVELTE_APP_URL="http://localhost:4001"

# ActiveJob queue adapter under test: async | inline | sidekiq | resque | delayed_job
SENTRY_E2E_ACTIVE_JOB_ADAPTER="async"

# Redis for the sidekiq/resque adapters (the Compose service is named "redis")
REDIS_URL="redis://redis:6379"

# Faster builds with compose
COMPOSE_BAKE=true
8 changes: 8 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ services:
command: ["mise", "run", "e2e:serve"]
environment:
BUNDLE_PATH: /home/sentry/bundle
depends_on:
redis:
condition: service_healthy
volumes:
- ..:/workspace/sentry:cached
- bundle-gems:/home/sentry/bundle
Expand All @@ -38,6 +41,11 @@ services:
- ALLOW_EMPTY_PASSWORD=yes
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
timeout: 3s
retries: 10

volumes:
bundle-gems:
25 changes: 16 additions & 9 deletions .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,24 @@ concurrency:

jobs:
e2e-tests:
name: e2e tests
name: e2e tests (ruby ${{ matrix.ruby.flavor }}, ${{ matrix.adapter }})
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 8

strategy:
fail-fast: false
matrix:
include:
- ruby_version: "3.4.9"
ruby:
- version: "3.4.9"
flavor: "3.4"
- ruby_version: "4.0.3"
- version: "4.0.3"
flavor: "4.0"
adapter:
- async
- inline
- sidekiq
- resque
- delayed_job

steps:
- name: Checkout code
Expand All @@ -42,9 +48,10 @@ jobs:
run: |
cd .devcontainer
cp .env.example .env
echo "RUBY_VERSION=${{ matrix.ruby_version }}" >> .env
echo "DOCKER_IMAGE=ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}" >> .env
echo "RUBY_VERSION=${{ matrix.ruby.version }}" >> .env
echo "DOCKER_IMAGE=ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.ruby.flavor }}" >> .env
echo "DOCKER_TAG=${{ steps.devcontainer-version.outputs.version }}" >> .env
echo "SENTRY_E2E_ACTIVE_JOB_ADAPTER=${{ matrix.adapter }}" >> .env

- name: Log in to GHCR
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
Expand All @@ -54,7 +61,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull test container image
run: docker pull ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.flavor }}:${{ steps.devcontainer-version.outputs.version }}
run: docker pull ghcr.io/getsentry/sentry-ruby-devcontainer-${{ matrix.ruby.flavor }}:${{ steps.devcontainer-version.outputs.version }}

- name: Restore node_modules cache
uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3
Expand Down Expand Up @@ -114,7 +121,7 @@ jobs:
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: e2e-test-logs-ruby-${{ matrix.ruby_version }}
name: e2e-test-logs-ruby-${{ matrix.ruby.version }}-${{ matrix.adapter }}
path: |
log/sentry_debug_events.log
retention-days: 7
6 changes: 5 additions & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ run = "cd spec/apps/rails-mini && bundle exec ruby app.rb"
description = "Start the svelte-mini e2e app"
run = "cd spec/apps/svelte-mini && npm run dev"

[tasks."e2e:worker"]
description = "Start the rails-mini ActiveJob worker (sidekiq/resque/delayed_job; idles for async/inline)"
run = "cd spec/apps/rails-mini && bundle exec ruby worker.rb"

[tasks."e2e:serve"]
description = "Start all e2e apps in parallel"
depends = ["e2e:rails", "e2e:svelte"]
depends = ["e2e:rails", "e2e:svelte", "e2e:worker"]
6 changes: 5 additions & 1 deletion sentry-delayed_job/gemfiles/ruby-2.7.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sentry-delayed_job/gemfiles/ruby-3.0.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sentry-delayed_job/gemfiles/ruby-3.1.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sentry-delayed_job/gemfiles/ruby-3.2.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sentry-delayed_job/gemfiles/ruby-3.3.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sentry-delayed_job/gemfiles/ruby-3.4.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions sentry-delayed_job/gemfiles/ruby-4.0.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sentry-delayed_job/gemfiles/ruby-jruby-9.4.14.0.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sentry-opentelemetry/gemfiles/ruby-2.7.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sentry-opentelemetry/gemfiles/ruby-4.0.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions sentry-rails/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,53 @@ end

gem "mini_magick"

# Sidekiq is a dev-only dependency, used by the common ActiveJob spec
# suite to verify the AJ tracing extension works against the :sidekiq
# adapter independent of sentry-sidekiq's native middleware.
#
# Gated on Ruby/Rails/platform because:
# - The sidekiq_adapter_spec only passes on Rails > 7.0.
# - Sidekiq 8 requires Ruby >= 3.2; older Rubies fall back to Sidekiq 7.
# - Sidekiq does not reliably support JRuby.
#
# sidekiq_adapter_spec.rb also rescues LoadError and re-checks the
# Rails version, so matrices that don't bundle Sidekiq skip the spec
# cleanly without any other gating.
unless RUBY_PLATFORM.include?("java")
if rails_version > Gem::Version.new("7.0.0") && ruby_version >= Gem::Version.new("3.2")
gem "sidekiq", "~> 8.0"
elsif rails_version > Gem::Version.new("7.0.0")
gem "sidekiq", "~> 7.0"
end
end

# delayed_job and resque are dev-only dependencies, used by the common
# ActiveJob spec suite to verify the AJ tracing extension works against
# the :delayed_job and :resque adapters independent of the dedicated
# sentry-delayed_job / sentry-resque integrations.
#
# Both spec files rescue LoadError and skip cleanly on matrices that
# don't bundle the gem, so the gating below only needs to keep
# `bundle install` resolvable — it doesn't have to be exact.
unless RUBY_PLATFORM.include?("java")
# delayed_job is backed by ActiveRecord here (delayed_job_active_record),
# reusing the dummy app's SQLite database. It supports every Ruby/Rails
# combination in the matrix.
gem "delayed_job"
gem "delayed_job_active_record"

# resque has no in-memory test mode, so the spec drives it through
# mock_redis instead of a live Redis (mirroring how the sidekiq context
# uses Sidekiq's fake mode). resque 3 / resque-scheduler 5 / mock_redis
# all require Ruby >= 3.0, so gate them on that — older matrices skip
# the resque spec via its LoadError rescue.
if ruby_version >= Gem::Version.new("3.0")
gem "resque"
gem "resque-scheduler", "~> 5.0"
gem "mock_redis"
end
end

gem "sprockets-rails"

gem "benchmark-ips"
Expand Down
Loading
Loading