From dc44dda30c47d86fdd6e80df04eccc41c58972ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 12 Aug 2021 02:54:46 +0200 Subject: [PATCH 1/3] Remove newrelic gem dependency We haven't updated the gem for years and don't know whether it still works with our current Ruby and Rails versions. Besides, dependabot keeps opening pull requests to update it. In theory we could just ignore the dependabot pull requests for this dependency, but unfortunately right now we can't add a dependabot config file because it would open pull requests on forks as well. Finally, there are other companies offering similar services for Rails applications, and it's up to each CONSUL installation to decide which one is better for them. We might add a self-hosted performance monitoring tool in the future. Since other CONSUL installations might be using Newrelic, and in general we recommend adding an application monitoring tool, we're suggesting it in the custom gemfile. In the name of neutrality, we're also adding Sentry. We might add other services in the future. --- Gemfile | 1 - Gemfile.lock | 2 -- Gemfile_custom | 21 ++++++++++++++++++++ config/newrelic.yml | 47 --------------------------------------------- 4 files changed, 21 insertions(+), 50 deletions(-) delete mode 100644 config/newrelic.yml diff --git a/Gemfile b/Gemfile index 44e3e9e51..deac05df8 100644 --- a/Gemfile +++ b/Gemfile @@ -33,7 +33,6 @@ gem "jquery-fileupload-rails" gem "jquery-rails", "~> 4.4.0" gem "jquery-ui-rails", "~> 6.0.1" gem "kaminari", "~> 1.2.1" -gem "newrelic_rpm", "~> 4.1.0.333" gem "omniauth", "~> 2.0.4" gem "omniauth-facebook", "~> 8.0.0" gem "omniauth-google-oauth2", "~> 1.0.0" diff --git a/Gemfile.lock b/Gemfile.lock index 48d612d2f..7fe97db76 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -387,7 +387,6 @@ GEM net-scp (3.0.0) net-ssh (>= 2.6.5, < 7.0.0) net-ssh (6.1.0) - newrelic_rpm (4.1.0.333) nio4r (2.5.8) nokogiri (1.12.5) mini_portile2 (~> 2.6.1) @@ -744,7 +743,6 @@ DEPENDENCIES launchy (~> 2.5.0) letter_opener_web (~> 1.4.0) mdl (~> 0.11.0) - newrelic_rpm (~> 4.1.0.333) omniauth (~> 2.0.4) omniauth-facebook (~> 8.0.0) omniauth-google-oauth2 (~> 1.0.0) diff --git a/Gemfile_custom b/Gemfile_custom index 9d91e0680..128ea0f26 100644 --- a/Gemfile_custom +++ b/Gemfile_custom @@ -3,3 +3,24 @@ # * English: https://github.com/consul/consul/blob/master/CUSTOMIZE_EN.md#gemfile # * Spanish: https://github.com/consul/consul/blob/master/CUSTOMIZE_ES.md#gemfile # + +###### Application monitoring services ###### +# +# By default Consul supports the Errbit self-hosted error monitoring service, +# through the Airbrake gem. That means Consul also supports using Airbrake as +# an external service to monitor errors and application performance. +# +# Here are some other services which can be used to monitor application errors +# and performance. + +# Newrelic is an external service which helps you monitor the application +# performance +# gem "newrelic_rpm", "insert_gem_version_here" + +# Sentry is an external or self-hosted service which helps you monitor the +# application errors and performance +# gem "sentry-ruby", "insert_gem_version_here" + +###### Other gems ###### +# +# Add your custom gem dependencies here diff --git a/config/newrelic.yml b/config/newrelic.yml deleted file mode 100644 index f2ebf5526..000000000 --- a/config/newrelic.yml +++ /dev/null @@ -1,47 +0,0 @@ -# -# This file configures the New Relic Agent. New Relic monitors Ruby, Java, -# .NET, PHP, Python and Node applications with deep visibility and low -# overhead. For more information, visit www.newrelic.com. -# -# Generated September 08, 2015, for version 3.13.0.299 -# -# For full documentation of agent configuration options, please refer to -# https://docs.newrelic.com/docs/agents/ruby-agent/installation-configuration/ruby-agent-configuration - -common: &default_settings - # Required license key associated with your New Relic account. - license_key: <%= Rails.application.secrets.newrelic_key %> - - # Your application name. Renaming here affects where data displays in New - # Relic. For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications - app_name: CONSUL - - # To disable the agent regardless of other settings, uncomment the following: - # agent_enabled: false - - # Logging level for log/newrelic_agent.log - log_level: info - - -# Environment-specific settings are in this section. -# RAILS_ENV or RACK_ENV (as appropriate) is used to determine the environment. -# If your application has other named environments, configure them here. -development: - <<: *default_settings - app_name: CONSUL (Development) - - # NOTE: There is substantial overhead when running in developer mode. - # Do not use for production or load testing. - developer_mode: true - -test: - <<: *default_settings - # It doesn't make sense to report to New Relic from automated test runs. - monitor_mode: false - -staging: - <<: *default_settings - app_name: CONSUL (Staging) - -production: - <<: *default_settings From b544ec89880c1bf2b68d69e6cac8d49a70e12f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 3 Oct 2021 16:12:35 +0200 Subject: [PATCH 2/3] Remove rollbar gem dependency We already support Errbit and Airbrake as error monitoring services. Since some people might not want to setup Errbit and might prefer Rollbar over Airbrake, we're referencing it in the custom gemfile. --- Gemfile | 1 - Gemfile.lock | 2 -- Gemfile_custom | 3 ++ config/initializers/rollbar.rb | 53 ---------------------------------- config/secrets.yml.example | 3 -- 5 files changed, 3 insertions(+), 59 deletions(-) delete mode 100644 config/initializers/rollbar.rb diff --git a/Gemfile b/Gemfile index deac05df8..34d07ffa6 100644 --- a/Gemfile +++ b/Gemfile @@ -47,7 +47,6 @@ gem "recipient_interceptor", "~> 0.3.0" gem "redcarpet", "~> 3.5.1" gem "responders", "~> 3.0.1" gem "rinku", "~> 2.0.6", require: "rails_rinku" -gem "rollbar", "~> 3.2.0" gem "sassc-rails", "~> 2.1.2" gem "savon", "~> 2.12.1" gem "sitemap_generator", "~> 6.1.2" diff --git a/Gemfile.lock b/Gemfile.lock index 7fe97db76..ebd507269 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -521,7 +521,6 @@ GEM retriable (3.1.2) rexml (3.2.5) rinku (2.0.6) - rollbar (3.2.0) rspec-core (3.10.1) rspec-support (~> 3.10.0) rspec-expectations (3.10.1) @@ -765,7 +764,6 @@ DEPENDENCIES redcarpet (~> 3.5.1) responders (~> 3.0.1) rinku (~> 2.0.6) - rollbar (~> 3.2.0) rspec-rails (~> 5.0) rubocop (~> 1.18.4) rubocop-performance (~> 1.11.4) diff --git a/Gemfile_custom b/Gemfile_custom index 128ea0f26..392e7ffef 100644 --- a/Gemfile_custom +++ b/Gemfile_custom @@ -21,6 +21,9 @@ # application errors and performance # gem "sentry-ruby", "insert_gem_version_here" +# Rollbar is an external service which helps you monitor the application errors +# gem "rollbar", "insert_gem_version_here" + ###### Other gems ###### # # Add your custom gem dependencies here diff --git a/config/initializers/rollbar.rb b/config/initializers/rollbar.rb deleted file mode 100644 index 3c5ecec3c..000000000 --- a/config/initializers/rollbar.rb +++ /dev/null @@ -1,53 +0,0 @@ -require "rollbar/rails" -Rollbar.configure do |config| - # Without configuration, Rollbar is enabled in all environments. - # To disable in specific environments, set config.enabled=false. - - config.access_token = Rails.application.secrets.rollbar_server_token - - # Here we'll disable all environments except 'staging', 'preproduction' and 'production': - if Rails.env.staging? || Rails.env.preproduction? || Rails.env.production? - config.enabled = Rails.application.secrets.rollbar_server_token.present? - else - config.enabled = false - end - - # By default, Rollbar will try to call the `current_user` controller method - # to fetch the logged-in user object, and then call that object's `id`, - # `username`, and `email` methods to fetch those properties. To customize: - # config.person_method = "my_current_user" - # config.person_id_method = "my_id" - # config.person_username_method = "my_username" - # config.person_email_method = "my_email" - - # If you want to attach custom data to all exception and message reports, - # provide a lambda like the following. It should return a hash. - # config.custom_data_method = lambda { {:some_key => "some_value" } } - - # Add exception class names to the exception_level_filters hash to - # change the level that exception is reported at. Note that if an exception - # has already been reported and logged the level will need to be changed - # via the rollbar interface. - # Valid levels: 'critical', 'error', 'warning', 'info', 'debug', 'ignore' - # 'ignore' will cause the exception to not be reported at all. - # config.exception_level_filters.merge!('MyCriticalException' => 'critical') - # - # You can also specify a callable, which will be called with the exception instance. - # config.exception_level_filters.merge!('MyCriticalException' => lambda { |e| 'critical' }) - - # Enable asynchronous reporting (uses girl_friday or Threading if girl_friday - # is not installed) - # config.use_async = true - # Supply your own async handler: - # config.async_handler = Proc.new { |payload| - # Thread.new { Rollbar.process_from_async_handler(payload) } - # } - - # Enable asynchronous reporting (using sucker_punch) - # config.use_sucker_punch - - # Enable delayed reporting (using Sidekiq) - # config.use_sidekiq - # You can supply custom Sidekiq options: - # config.use_sidekiq 'queue' => 'my_queue' -end diff --git a/config/secrets.yml.example b/config/secrets.yml.example index cadf77761..dc335a7c5 100644 --- a/config/secrets.yml.example +++ b/config/secrets.yml.example @@ -44,7 +44,6 @@ staging: errbit_project_key: "" errbit_project_id: 1 errbit_self_hosted_ssl: false - rollbar_server_token: "" http_basic_username: "" http_basic_password: "" managers_url: "" @@ -71,7 +70,6 @@ preproduction: errbit_project_key: "" errbit_project_id: 1 errbit_self_hosted_ssl: false - rollbar_server_token: "" http_basic_username: "" http_basic_password: "" managers_url: "" @@ -103,7 +101,6 @@ production: errbit_project_key: "" errbit_project_id: 1 errbit_self_hosted_ssl: false - rollbar_server_token: "" http_basic_username: "" http_basic_password: "" managers_url: "" From 0349f0b1a392ad007d5da59f787a123f1e1bf1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 3 Oct 2021 16:44:49 +0200 Subject: [PATCH 3/3] Remove obsolete comments in Gemfile_custom The CUSTOMIZE files don't exist anymore. --- Gemfile_custom | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Gemfile_custom b/Gemfile_custom index 392e7ffef..d48adb7d2 100644 --- a/Gemfile_custom +++ b/Gemfile_custom @@ -1,8 +1,4 @@ -# Overrides and adds customized gems in this file -# Read more on documentation: -# * English: https://github.com/consul/consul/blob/master/CUSTOMIZE_EN.md#gemfile -# * Spanish: https://github.com/consul/consul/blob/master/CUSTOMIZE_ES.md#gemfile -# +# Add custom gem dependencies in this file. ###### Application monitoring services ###### #