Skip to content

Disable SolidAPM in test - #21

Merged
Bhacaz merged 2 commits into
mainfrom
test_env_config
Feb 3, 2026
Merged

Bhacaz merged 2 commits into
mainfrom
test_env_config

Conversation

@Bhacaz

@Bhacaz Bhacaz commented Feb 3, 2026

Copy link
Copy Markdown
Owner

This pull request introduces a configurable enabled flag to SolidAPM, allowing the APM functionality to be disabled, with automatic disabling in the test environment to prevent test pollution and improve test performance. The changes ensure that SolidAPM's middleware and subscribers are only active when enabled, and provide documentation and tests for this behavior.

Configuration and Environment Handling:

  • Added a SolidApm.enabled configuration flag, defaulting to true, and automatically set to false in the test environment via a new Railtie (lib/solid_apm.rb, lib/solid_apm/railtie.rb, [1] [2].
  • Updated documentation in README.md to explain the new enabled flag and its default behavior in the test environment.

Middleware and Subscriber Activation:

  • Modified the initialization of middleware and span subscribers to respect the enabled flag, ensuring they are only active when SolidAPM is enabled (lib/solid_apm/engine.rb, [1] [2].
  • Updated the middleware to bypass tracking when SolidAPM is disabled (lib/solid_apm/middleware.rb, lib/solid_apm/middleware.rbR10-R11).

@Bhacaz
Bhacaz merged commit c0a6c5f into main Feb 3, 2026
1 check passed
@Bhacaz
Bhacaz deleted the test_env_config branch February 3, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant