Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't start for 'rails runner' and 'rails db' #2623

Merged
merged 1 commit into from
May 3, 2024
Merged

Conversation

fallwith
Copy link
Contributor

@fallwith fallwith commented May 3, 2024

Add Rails::Command::RunnerCommand for bin/rails runner commands and Rails::Command::RakeCommand for bin/rails db command to the list of denylisted constants that will prevent the agent from autostarting when seen.

Now when bin/rails runner and bin/rails db commands are ran, the agent will recognize those contexts and not start
automatically.

Older agent versions that are still supported by New Relic can update to the new list of denylisted constants by having the following line added to the newrelic.yml configuration file:

autostart.denylisted_constants: "Rails::Command::ConsoleCommand,Rails::Command::CredentialsCommand,Rails::Command::Db::System::ChangeCommand,Rails::Command::DbConsoleCommand,Rails::Command::DestroyCommand,Rails::Command::DevCommand,Rails::Command::EncryptedCommand,Rails::Command::GenerateCommand,Rails::Command::InitializersCommand,Rails::Command::NotesCommand,Rails::Command::RakeCommand,Rails::Command::RoutesCommand,Rails::Command::RunnerCommand,Rails::Command::SecretsCommand,Rails::Console,Rails::DBConsole"

resolves #2596

Add `Rails::Command::RunnerCommand` for `bin/rails runner` commands
and `Rails::Command::RakeCommand` for `bin/rails db` command to the list
of denylisted constants that will prevent the agent from autostarting
when seen.

Now when `bin/rails runner` and `bin/rails db` commands are ran, the
agent will recognize those contexts and not start
automatically.

Older agent versions that are still supported by New Relic can update to
the new list of denylisted constants by having the following line added
to the `newrelic.yml` configuration file:

```yaml
autostart.denylisted_constants: "Rails::Command::ConsoleCommand,Rails::Command::CredentialsCommand,Rails::Command::Db::System::ChangeCommand,Rails::Command::DbConsoleCommand,Rails::Command::DestroyCommand,Rails::Command::DevCommand,Rails::Command::EncryptedCommand,Rails::Command::GenerateCommand,Rails::Command::InitializersCommand,Rails::Command::NotesCommand,Rails::Command::RakeCommand,Rails::Command::RoutesCommand,Rails::Command::RunnerCommand,Rails::Command::SecretsCommand,Rails::Console,Rails::DBConsole"
```
Copy link
Contributor

github-actions bot commented May 3, 2024

SimpleCov Report

Coverage Threshold
Line 93.76% 93%
Branch 71.46% 71%

Copy link
Contributor

@hannahramadan hannahramadan left a comment

Choose a reason for hiding this comment

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

thanks for explaing live!

@fallwith fallwith merged commit 5d2a2db into dev May 3, 2024
31 checks passed
@fallwith fallwith deleted the matter_eric_lune branch May 3, 2024 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

bin/rails subcommands other than "server" continue to involve the agent but shouldn't
3 participants