Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
daa38f1
feat(rails): add messaging span data to ActiveJob consumer transaction
solnic May 7, 2026
b81b592
feat(rails): emit producer span when enqueueing ActiveJob
solnic May 7, 2026
73d115d
feat(rails): propagate trace context through ActiveJob payload
solnic May 7, 2026
723ff33
fixup(rails): account for AJ producer span in active_storage subscrib…
solnic May 7, 2026
2f3719e
feat(active_job): propagate allowed user context
solnic May 7, 2026
cf57a28
feat(rails): isolate Sentry hub per worker thread for ActiveJob
solnic May 7, 2026
25f8ca5
refactor(rails): bundle ActiveJob tracing examples into a distributed…
solnic May 7, 2026
9a68324
fixup(rails): widen latency tolerance on Rails < 7 in messaging_span_…
solnic May 7, 2026
0e47349
refactor(rails): introduce worker_thread harness hook for the hub-iso…
solnic May 7, 2026
0d2c79a
fix(rails): no with_usec in 7.0
solnic May 8, 2026
bfccb0e
chore(rails): patch AJ test adapter for 5.2
solnic May 12, 2026
3107e52
fix(active_job): always emit retry count on the consumer transaction
solnic May 12, 2026
62e9d47
feat(active_job): add active_job_propagate_traces config option
solnic May 12, 2026
b311bb4
feat(active_job): set scope tags and context on consumer like Sidekiq
solnic May 12, 2026
b2f6052
fix(active_job): avoid shared queue race in jruby
solnic May 12, 2026
7fd6242
fix(active_job): save and restore hub around job execution
solnic May 12, 2026
847737e
fix(active_job): better specs for thread isolation
solnic May 12, 2026
e9cf1c7
fix(active_job): correct retry counter
solnic May 12, 2026
5d97544
fix(active_job): widen manual flushing to rails < 6.1
solnic May 20, 2026
037540c
refactor(active_job): make the spec harness adapter-agnostic
solnic May 20, 2026
dfe8485
test(active_job): verify the AJ tracing suite passes on the :sidekiq …
solnic May 20, 2026
9b2d9a7
test(e2e): end-to-end ActiveJob distributed-tracing spec
solnic May 20, 2026
5f1a634
perf(active_job): boot the dummy app once per spec group
solnic May 21, 2026
3d2223d
tests(active_job): add basic scenario for active_job_propagate_traces
solnic May 22, 2026
cb8c479
refa(active_job): log more details when adding sentry payload fails
solnic May 22, 2026
60762a6
refa(active_job): store our stuff under single _sentry ivar
solnic May 22, 2026
226894a
refa(active_job): better thread isolation spec
solnic May 25, 2026
f8e909f
tests(active_job): request-based hub isolation coverage
solnic May 25, 2026
092b723
fix(active_job): calc latency to reduce flakiness
solnic May 25, 2026
740fba2
feat(rails): add dj/resque adapter specs
solnic May 29, 2026
09c5e3c
chore: update lockfiles
solnic Jun 12, 2026
c051d8e
refactor(active_job): ensure enqueue won't crash due to sentry crashing
solnic Jun 15, 2026
5ff0015
fix(active_job): symbolize user keys for proper scope handling
solnic Jun 15, 2026
9f7fa02
tests(rails): ensure our instrumentation failures do not break AJ bac…
solnic Jun 16, 2026
8e07cde
tests(rails): ensure queue.publish is emitted regardless of propagate…
solnic Jun 16, 2026
08ccec5
refactor(rails): remove dead defaulting to {} for user
solnic Jun 16, 2026
a467cd7
refactor(rails): use consumer_transaction helper
solnic Jun 16, 2026
49aa99c
fix(rails): relax spying to make the spec pass under old rails
solnic Jun 16, 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