Skip to content

Commit

Permalink
Merge pull request #106 from MITLibraries/tco-87-scout
Browse files Browse the repository at this point in the history
ScoutAPM
  • Loading branch information
JPrevost authored Sep 18, 2024
2 parents f36107b + 30d6bcf commit d5256c1
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ gem 'omniauth'
gem 'omniauth_openid_connect'
gem 'omniauth-rails_csrf_protection'

# Parser added explicitly to allow for the namespace to be available for scout
gem 'parser'

# Use the Puma web server [https://github.com/puma/puma]
gem 'puma', '>= 5.0'

# Performance Monitoring
gem 'scout_apm'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'rails', '~> 7.1.2'

Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
scout_apm (5.4.0)
parser
selectize-rails (0.12.6)
selenium-webdriver (4.23.0)
base64 (~> 0.2)
Expand Down Expand Up @@ -481,6 +483,7 @@ DEPENDENCIES
omniauth
omniauth-rails_csrf_protection
omniauth_openid_connect
parser
pg
puma (>= 5.0)
rack-cors
Expand All @@ -491,6 +494,7 @@ DEPENDENCIES
rubocop-minitest
rubocop-performance
rubocop-rails
scout_apm
selenium-webdriver
simplecov
simplecov-lcov
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ If you need to regenerate these cassettes, the following procedure should be suf
`PLATFORM_NAME`: The value set is added to the header after the MIT Libraries logo. The logic and CSS for this comes
from our theme gem.

Scout settings can be controlled via `config/scout_apm.yml` or ENV. ENV overrides config.
Lots more [Scout settings](https://scoutapm.com/docs/ruby/configuration#environment-variables) available.
`SCOUT_KEY`: ScoutAPM key. Do not set in dev or test.
`SCOUT_LOG_LEVEL`: defaults to INFO which is probably fine. Controls verboseness of Scout logs
`SCOUT_NAME`: set a unique name per deployed tier to avoid confusion.

### Authentication

#### Required in all environments
Expand Down
49 changes: 49 additions & 0 deletions config/scout_apm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This configuration file is used for Scout APM.
# Environment variables can also be used to configure Scout. See our help docs at https://scoutapm.com/docs/ruby/configuration#environment-variables for more information.
common: &defaults

# key: Your Organization key for Scout APM. Found on the settings screen.
# - Default: none
# key: We set this ENV `SCOUT_KEY`

# log_level: Verboseness of logs.
# - Default: 'info'
# - Valid Options: debug, info, warn, error
# log_level: debug
# TIP: this can be set via ENV `SCOUT_LOG_LEVEL` to change without redeploy

# use_prepend: Use the newer `prepend` instrumentation method. In some cases, gems
# that use `alias_method` can conflict with gems that use `prepend`.
# To avoid the conflict, change this setting to match the method
# that the other gems use.
# If you have another APM gem installed, such as DataDog or NewRelic,
# you will likely want to set `use_prepend` to true.
#
# See https://scoutapm.com/docs/ruby/configuration#library-instrumentation-method
# for more information.
# - Default: false
# - Valid Options: true, false
# use_prepend: true

# name: Application name in APM Web UI
# - Default: the application names comes from the Rails or Sinatra class name
# name:

# monitor: Enable Scout APM or not
# - Default: none
# - Valid Options: true, false
monitor: true

production:
<<: *defaults

development:
<<: *defaults
monitor: false

test:
<<: *defaults
monitor: false

staging:
<<: *defaults

0 comments on commit d5256c1

Please sign in to comment.