diff --git a/Gemfile b/Gemfile index e2b74e10..8ade18ca 100644 --- a/Gemfile +++ b/Gemfile @@ -125,7 +125,7 @@ group :production do gem 'clamby' end -group :xray do +group :aws do # xray application monitoring through aws gem 'aws-xray-sdk', require: ['aws-xray-sdk/facets/rails/railtie'] end diff --git a/Gemfile.lock b/Gemfile.lock index 833b6bcc..209d6d18 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -167,10 +167,11 @@ GEM aws-sdk-core (~> 3, >= 3.125.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) - aws-sigv4 (1.4.0) aws-sdk-xray (1.4.0) + aws-eventstream (~> 1, >= 1.0.2) aws-sdk-core (~> 3) aws-sigv4 (~> 1.0) + aws-sigv4 (1.4.0) aws-eventstream (~> 1, >= 1.0.2) aws-xray-sdk (0.13.0) aws-sdk-xray (~> 1.4.0) diff --git a/config/deploy/curly.rb b/config/deploy/curly.rb index 380657f3..8958c986 100644 --- a/config/deploy/curly.rb +++ b/config/deploy/curly.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true set :rails_env, :development -set :bundle_without, %w[production test].join(' ') +set :bundle_without, %w[production test aws].join(' ') set :branch, 'sandbox' set :default_env, path: "$PATH:/usr/sbin/" set :bundle_path, -> { shared_path.join('vendor/bundle') } diff --git a/config/deploy/local.rb b/config/deploy/local.rb index e2308eef..a4e76af6 100644 --- a/config/deploy/local.rb +++ b/config/deploy/local.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true set :rails_env, :development -set :bundle_without, %w[production test].join(' ') +set :bundle_without, %w[production test aws].join(' ') set :branch, 'chore/#761-deployment-alternative' set :default_env, path: "$PATH:/usr/local/bin" append :linked_files, "db/development.sqlite3" diff --git a/config/initializers/aws_xray.rb b/config/initializers/aws_xray.rb index 0ce05111..27ffbedb 100644 --- a/config/initializers/aws_xray.rb +++ b/config/initializers/aws_xray.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true Rails.application.config.xray = { -name: "Scholar-#{Rails.env}@uc", -patch: %I[net_http aws_sdk], -# record db transactions as subsegments -active_record: true, -context_missing: 'LOG_ERROR', -# Makes sure the log file size does not go beyond a size, beyond which it is rotated. -# Only the latest rotated log will be retained. That is, the max possible size on disk of log files, -# if `SCHOLAR_XRAY_MAX_LOG_SIZE` is set to 10, would be 10MB(for the actual log) + 10MB(for the latest rotated log). -logger: Logger.new("log/#{Rails.env}-xray.log", 1, Integer(ENV.fetch("SCHOLAR_XRAY_MAX_LOG_SIZE", "10"), 10).megabytes) -} \ No newline at end of file + name: "Scholar-#{Rails.env}@uc", + patch: %I[net_http aws_sdk], + # record db transactions as subsegments + active_record: true, + context_missing: 'LOG_ERROR', + # Makes sure the log file size does not go beyond a size, beyond which it is rotated. + # Only the latest rotated log will be retained. That is, the max possible size on disk of log files, + # if `SCHOLAR_XRAY_MAX_LOG_SIZE` is set to 10, would be 10MB(for the actual log) + 10MB(for the latest rotated log). + logger: Logger.new("log/#{Rails.env}-xray.log", 1, Integer(ENV.fetch("SCHOLAR_XRAY_MAX_LOG_SIZE", "10"), 10).megabytes) +}