Skip to content

Commit

Permalink
Add xray group to Gemfile
Browse files Browse the repository at this point in the history
  • Loading branch information
bsp3ars committed Jan 25, 2022
1 parent 82a5051 commit 1aacad5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ gem 'rack', '2.0.8'
gem 'sidekiq-limit_fetch'
gem 'willow_sword', github: 'notch8/willow_sword'

# xray application monitoring through aws
# gem 'aws-xray-sdk', require: ['aws-xray-sdk/facets/rails/railtie']

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.7'
# Use sqlite3 as the database for Active Record
Expand Down Expand Up @@ -127,3 +124,8 @@ end
group :production do
gem 'clamby'
end

group :xray do
# xray application monitoring through aws
gem 'aws-xray-sdk', require: ['aws-xray-sdk/facets/rails/railtie']
end
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,14 @@ GEM
aws-sdk-core (~> 3, >= 3.119.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sdk-xray (1.4.0)
aws-sdk-core (~> 3)
aws-sigv4 (~> 1.0)
aws-sigv4 (1.2.2)
aws-eventstream (~> 1, >= 1.0.2)
aws-xray-sdk (0.13.0)
aws-sdk-xray (~> 1.4.0)
multi_json (~> 1)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
Expand Down Expand Up @@ -1124,6 +1130,7 @@ PLATFORMS
DEPENDENCIES
active-fedora (= 11.5.4)
active_attr
aws-xray-sdk
bigdecimal (= 1.3.5)
bixby (>= 1.0.0)
bootstrap-sass (~> 3.4.1)
Expand Down
23 changes: 11 additions & 12 deletions config/initializers/aws_xray.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# frozen_string_literal: true
# # 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)
# }
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)
}

0 comments on commit 1aacad5

Please sign in to comment.