Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c937cb0
feat(rails): add messaging span data to ActiveJob consumer transaction
solnic May 7, 2026
4d734cf
feat(rails): emit producer span when enqueueing ActiveJob
solnic May 7, 2026
bc8c698
feat(rails): propagate trace context through ActiveJob payload
solnic May 7, 2026
ea81324
fixup(rails): account for AJ producer span in active_storage subscrib…
solnic May 7, 2026
aae2fbf
feat(active_job): propagate allowed user context
solnic May 7, 2026
61a40df
feat(rails): isolate Sentry hub per worker thread for ActiveJob
solnic May 7, 2026
613c4ef
refactor(rails): bundle ActiveJob tracing examples into a distributed…
solnic May 7, 2026
748b7f4
fixup(rails): widen latency tolerance on Rails < 7 in messaging_span_…
solnic May 7, 2026
a4105e1
refactor(rails): introduce worker_thread harness hook for the hub-iso…
solnic May 7, 2026
b5d6cc9
fix(rails): no with_usec in 7.0
solnic May 8, 2026
d6eec3d
chore(rails): patch AJ test adapter for 5.2
solnic May 12, 2026
408d5f6
fix(active_job): always emit retry count on the consumer transaction
solnic May 12, 2026
739764f
feat(active_job): add active_job_propagate_traces config option
solnic May 12, 2026
bc0024b
feat(active_job): set scope tags and context on consumer like Sidekiq
solnic May 12, 2026
2455028
fix(active_job): avoid shared queue race in jruby
solnic May 12, 2026
4c05b55
fix(active_job): save and restore hub around job execution
solnic May 12, 2026
60df906
fix(active_job): better specs for thread isolation
solnic May 12, 2026
f7ee2f0
fix(active_job): correct retry counter
solnic May 12, 2026
0b2090b
fix(active_job): widen manual flushing to rails < 6.1
solnic May 20, 2026
9f064ba
refactor(active_job): make the spec harness adapter-agnostic
solnic May 20, 2026
27763f6
test(active_job): verify the AJ tracing suite passes on the :sidekiq …
solnic May 20, 2026
40163ad
test(e2e): end-to-end ActiveJob distributed-tracing spec
solnic May 20, 2026
ada0545
perf(active_job): boot the dummy app once per spec group
solnic May 21, 2026
bb7f490
tests(active_job): add basic scenario for active_job_propagate_traces
solnic May 22, 2026
36a383a
refa(active_job): log more details when adding sentry payload fails
solnic May 22, 2026
33fb3b7
refa(active_job): store our stuff under single _sentry ivar
solnic May 22, 2026
db3c2de
refa(active_job): better thread isolation spec
solnic May 25, 2026
bcdaac9
tests(active_job): request-based hub isolation coverage
solnic May 25, 2026
e652cae
fix(active_job): calc latency to reduce flakiness
solnic May 25, 2026
d072fd5
feat(rails): add dj/resque adapter specs
solnic May 29, 2026
82a9095
chore: update lockfiles
solnic Jun 12, 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"]
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
13 changes: 13 additions & 0 deletions sentry-rails/gemfiles/ruby-2.7_rails-5.2.0.gemfile.lock

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

13 changes: 13 additions & 0 deletions sentry-rails/gemfiles/ruby-2.7_rails-6.0.0.gemfile.lock

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

13 changes: 13 additions & 0 deletions sentry-rails/gemfiles/ruby-2.7_rails-6.1.0.gemfile.lock

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

12 changes: 12 additions & 0 deletions sentry-rails/gemfiles/ruby-2.7_rails-7.0.0.gemfile.lock

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

Loading
Loading