Skip to content

Add config options to control instrumentation - #1545

Merged
unflxw merged 3 commits into
mainfrom
prepare-minor-release
Jul 15, 2026
Merged

Add config options to control instrumentation#1545
unflxw merged 3 commits into
mainfrom
prepare-minor-release

Conversation

@unflxw

@unflxw unflxw commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Prepare a minor release before the OpenTelemetry collector PR (#1535) lands. It adds a config option for every background job framework and library that lacked one, adds an option to turn background job enqueue instrumentation off, and consolidates the per-library enqueue changesets into a single entry.

The diagnose test expectations live in a submodule. This branch bumps it to a commit from appsignal/diagnose_tests#155, which adds the new options. That companion PR needs to merge before the diagnose CI job here can pass.


Merge the enqueue changesets into one

The last few releases added enqueue instrumentation one library at a
time, each with its own changeset. They now ship together in one minor
release, so combine them into a single changeset that lists every
library. No changelog entry is lost, it is just told as one story.

Add config options to control instrumentation

Add an instrument option for each background job framework and library
that lacked one. Sidekiq, Shoryuken, Que, Resque, Delayed Job, Active
Job, Excon and MongoDB can now each be turned off through
instrument_, matching the existing options for Faraday, http.rb,
Net::HTTP, Redis and Sequel. Setting one to false makes the hook report
its dependencies as absent, so the integration never installs. That
turns off both the job or request instrumentation and the enqueue
instrumentation for that framework.

Add the enable_job_enqueue_instrumentation option. When it is false,
job_enqueue_events_suppressed? reports true, which every enqueue
integration already checks before recording its event. This reuses the
existing enqueue suppression path, so one option turns the enqueue
events off everywhere without touching how the jobs themselves are
instrumented. The Active Job integration did not check that flag for its
own event yet, so it now does, the same way the standalone adapters do.

Update diagnose tests for the new config options

The diagnose output lists every config option, so the diagnose test
expectations have to include the new instrument options and the
enable_job_enqueue_instrumentation option. Point the submodule at the
diagnose_tests commit that adds them.

unflxw added 3 commits July 14, 2026 17:30
The last few releases added enqueue instrumentation one library at a
time, each with its own changeset. They now ship together in one minor
release, so combine them into a single changeset that lists every
library. No changelog entry is lost, it is just told as one story.
Add an instrument option for each background job framework and library
that lacked one. Sidekiq, Shoryuken, Que, Resque, Delayed Job, Active
Job, Excon and MongoDB can now each be turned off through
instrument_<name>, matching the existing options for Faraday, http.rb,
Net::HTTP, Redis and Sequel. Setting one to false makes the hook report
its dependencies as absent, so the integration never installs. That
turns off both the job or request instrumentation and the enqueue
instrumentation for that framework.

Add the enable_job_enqueue_instrumentation option. When it is false,
job_enqueue_events_suppressed? reports true, which every enqueue
integration already checks before recording its event. This reuses the
existing enqueue suppression path, so one option turns the enqueue
events off everywhere without touching how the jobs themselves are
instrumented. The Active Job integration did not check that flag for its
own event yet, so it now does, the same way the standalone adapters do.
The diagnose output lists every config option, so the diagnose test
expectations have to include the new instrument options and the
enable_job_enqueue_instrumentation option. Point the submodule at the
diagnose_tests commit that adds them.
@backlog-helper

backlog-helper Bot commented Jul 14, 2026

Copy link
Copy Markdown

鉁旓笍 All good!

New issue guide | Backlog management | Rules | Feedback

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares a minor release by adding configuration switches to control background job and library instrumentation, including a global option to suppress enqueue event recording across all enqueue integrations, and by consolidating prior per-library enqueue changesets into unified release notes.

Changes:

  • Add enable_job_enqueue_instrumentation to globally suppress enqueue event recording without disabling job/request instrumentation.
  • Add per-integration instrument_* config options (and env vars) to disable specific hooks entirely.
  • Consolidate multiple enqueue-related changesets into unified changeset entries.

Reviewed changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated no comments.

Show a summary per file
File Description
spec/lib/appsignal/transaction_spec.rb Adds coverage for job_enqueue_events_suppressed? default/disabled behavior.
spec/lib/appsignal/hooks/sidekiq_spec.rb Verifies Sidekiq hook dependency gating via instrument_sidekiq.
spec/lib/appsignal/hooks/shoryuken_spec.rb Verifies Shoryuken hook dependency gating via instrument_shoryuken.
spec/lib/appsignal/hooks/resque_spec.rb Verifies Resque hook dependency gating via instrument_resque.
spec/lib/appsignal/hooks/que_spec.rb Verifies Que hook dependency gating via instrument_que.
spec/lib/appsignal/hooks/mongo_ruby_driver_spec.rb Verifies Mongo hook dependency gating via instrument_mongo.
spec/lib/appsignal/hooks/excon_spec.rb Verifies Excon hook dependency gating via instrument_excon.
spec/lib/appsignal/hooks/delayed_job_spec.rb Verifies Delayed Job hook dependency gating via instrument_delayed_job.
spec/lib/appsignal/hooks/activejob_spec.rb Verifies Active Job hook dependency gating and enqueue suppression behavior.
spec/lib/appsignal/config_spec.rb Extends config/env expectation fixtures for the new options.
sig/appsignal.rbs Adds RBS definitions for the new config accessors.
sig/appsignal.rbi Adds RBI (Sorbet) definitions for the new config accessors.
lib/appsignal/transaction.rb Makes enqueue suppression reflect enable_job_enqueue_instrumentation.
lib/appsignal/hooks/sidekiq.rb Gates Sidekiq hook installation on instrument_sidekiq.
lib/appsignal/hooks/shoryuken.rb Gates Shoryuken hook installation on instrument_shoryuken.
lib/appsignal/hooks/resque.rb Gates Resque hook installation on instrument_resque.
lib/appsignal/hooks/que.rb Gates Que hook installation on instrument_que.
lib/appsignal/hooks/mongo_ruby_driver.rb Gates Mongo hook installation on instrument_mongo.
lib/appsignal/hooks/excon.rb Gates Excon hook installation on instrument_excon.
lib/appsignal/hooks/delayed_job.rb Gates Delayed Job hook installation on instrument_delayed_job.
lib/appsignal/hooks/active_job.rb Gates Active Job hook installation on instrument_active_job and respects enqueue suppression for its event.
lib/appsignal/config.rb Adds defaults, env var mappings, and YARD docs for the new config options.
.changesets/title-sidekiq-delayed-enqueues-by-target.md Removes prior per-library enqueue-related changeset (now consolidated).
.changesets/instrument-sidekiq-enqueues.md Removes prior per-library enqueue-related changeset (now consolidated).
.changesets/instrument-resque-enqueues.md Removes prior per-library enqueue-related changeset (now consolidated).
.changesets/instrument-que-enqueues.md Removes prior per-library enqueue-related changeset (now consolidated).
.changesets/instrument-active-job-enqueues.md Removes prior per-library enqueue-related changeset (now consolidated).
.changesets/emit-mongodb-body-as-json-string.md Removes prior per-library Mongo-related changeset (now consolidated elsewhere).
.changesets/add-shoryuken-enqueue-instrumentation.md Removes prior per-library enqueue-related changeset (now consolidated).
.changesets/add-delayed-job-enqueue-instrumentation.md Removes prior per-library enqueue-related changeset (now consolidated).
.changesets/instrument-background-job-enqueues.md Adds consolidated enqueue instrumentation changeset with global suppression option documented.
.changesets/add-instrument-config-options.md Adds changeset documenting new per-integration instrument_* config options.
Files not reviewed (1)
  • sig/appsignal.rbi: File type not supported

馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unflxw
unflxw requested a review from tombruijn July 15, 2026 06:42
@tombruijn tombruijn added the enhancement An improvement to an existing feature. label Jul 15, 2026
@unflxw
unflxw merged commit 6182e02 into main Jul 15, 2026
482 of 484 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An improvement to an existing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants