Skip to content

Commit

Permalink
Merge pull request #14 from mlibrary/monitoring
Browse files Browse the repository at this point in the history
Monitoring
  • Loading branch information
niquerio authored Jun 8, 2022
2 parents 23f0aa4 + 9d90092 commit c60e508
Show file tree
Hide file tree
Showing 11 changed files with 144 additions and 105 deletions.
2 changes: 2 additions & 0 deletions .env-dev-values
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ CIRC_REPORT_PATH=/circ/report/path
PATRON_REPORT_PATH=/patron/report/path
ALMA_API_HOST=http://falma:4567
RAILS_LOG_TO_STDOUT=1
PROMETHEUS_JOB_NAME=checkout_history
PROMETHEUS_PUSH_GATEWAY=http://pushgateway:9091
8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ gem "mysql2", "~> 0.5"
gem "puma", "~> 5.0"
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem "jbuilder", "~> 2.7"
gem "faker" # needed for the dev_seed task.

# needed in production gems for the dev_seed task which is needed for loading up the testing namespace db.
gem "faker"

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", ">= 1.4.4", require: false

gem "amazing_print"
gem "rails_semantic_logger"
gem "yabeda-rails"
gem "yabeda-puma-plugin"
gem "yabeda-prometheus"

gem "prometheus-client"
gem "alma_rest_client",
git: "https://github.com/mlibrary/alma_rest_client",
tag: "1.3.1"
Expand Down
174 changes: 99 additions & 75 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,76 +11,78 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.2.3)
actionpack (= 7.0.2.3)
activesupport (= 7.0.2.3)
actioncable (7.0.3)
actionpack (= 7.0.3)
activesupport (= 7.0.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.2.3)
actionpack (= 7.0.2.3)
activejob (= 7.0.2.3)
activerecord (= 7.0.2.3)
activestorage (= 7.0.2.3)
activesupport (= 7.0.2.3)
actionmailbox (7.0.3)
actionpack (= 7.0.3)
activejob (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.2.3)
actionpack (= 7.0.2.3)
actionview (= 7.0.2.3)
activejob (= 7.0.2.3)
activesupport (= 7.0.2.3)
actionmailer (7.0.3)
actionpack (= 7.0.3)
actionview (= 7.0.3)
activejob (= 7.0.3)
activesupport (= 7.0.3)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.2.3)
actionview (= 7.0.2.3)
activesupport (= 7.0.2.3)
actionpack (7.0.3)
actionview (= 7.0.3)
activesupport (= 7.0.3)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.2.3)
actionpack (= 7.0.2.3)
activerecord (= 7.0.2.3)
activestorage (= 7.0.2.3)
activesupport (= 7.0.2.3)
actiontext (7.0.3)
actionpack (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.2.3)
activesupport (= 7.0.2.3)
actionview (7.0.3)
activesupport (= 7.0.3)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.2.3)
activesupport (= 7.0.2.3)
activejob (7.0.3)
activesupport (= 7.0.3)
globalid (>= 0.3.6)
activemodel (7.0.2.3)
activesupport (= 7.0.2.3)
activerecord (7.0.2.3)
activemodel (= 7.0.2.3)
activesupport (= 7.0.2.3)
activestorage (7.0.2.3)
actionpack (= 7.0.2.3)
activejob (= 7.0.2.3)
activerecord (= 7.0.2.3)
activesupport (= 7.0.2.3)
activemodel (7.0.3)
activesupport (= 7.0.3)
activerecord (7.0.3)
activemodel (= 7.0.3)
activesupport (= 7.0.3)
activestorage (7.0.3)
actionpack (= 7.0.3)
activejob (= 7.0.3)
activerecord (= 7.0.3)
activesupport (= 7.0.3)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.2.3)
activesupport (7.0.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
amazing_print (1.4.0)
anyway_config (2.3.0)
ruby-next-core (>= 0.14.0)
ast (2.4.2)
bootsnap (1.11.1)
bootsnap (1.12.0)
msgpack (~> 1.2)
builder (3.2.4)
byebug (11.1.3)
Expand All @@ -97,13 +99,14 @@ GEM
diff-lcs (1.5.0)
digest (3.1.0)
docile (1.4.0)
dry-initializer (3.1.1)
erubi (1.10.0)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faker (2.20.0)
faker (2.21.0)
i18n (>= 1.8.11, < 2)
ffi (1.15.5)
globalid (1.0.0)
Expand All @@ -117,10 +120,11 @@ GEM
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
json (2.6.2)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.16.0)
loofah (2.18.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
Expand All @@ -132,9 +136,9 @@ GEM
mime-types-data (3.2022.0105)
mini_mime (1.1.2)
minitest (5.15.0)
msgpack (1.4.5)
msgpack (1.5.2)
multi_xml (0.6.0)
mysql2 (0.5.3)
mysql2 (0.5.4)
net-imap (0.2.3)
digest
net-protocol
Expand All @@ -150,33 +154,33 @@ GEM
net-protocol
timeout
nio4r (2.5.8)
nokogiri (1.13.3-x86_64-linux)
nokogiri (1.13.6-x86_64-linux)
racc (~> 1.4)
parallel (1.22.1)
parser (3.1.1.0)
parser (3.1.2.0)
ast (~> 2.4.1)
prometheus-client (4.0.0)
public_suffix (4.0.6)
prometheus-client (2.1.0)
public_suffix (4.0.7)
puma (5.6.4)
nio4r (~> 2.0)
racc (1.6.0)
rack (2.2.3)
rack (2.2.3.1)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (7.0.2.3)
actioncable (= 7.0.2.3)
actionmailbox (= 7.0.2.3)
actionmailer (= 7.0.2.3)
actionpack (= 7.0.2.3)
actiontext (= 7.0.2.3)
actionview (= 7.0.2.3)
activejob (= 7.0.2.3)
activemodel (= 7.0.2.3)
activerecord (= 7.0.2.3)
activestorage (= 7.0.2.3)
activesupport (= 7.0.2.3)
rails (7.0.3)
actioncable (= 7.0.3)
actionmailbox (= 7.0.3)
actionmailer (= 7.0.3)
actionpack (= 7.0.3)
actiontext (= 7.0.3)
actionview (= 7.0.3)
activejob (= 7.0.3)
activemodel (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
bundler (>= 1.15.0)
railties (= 7.0.2.3)
railties (= 7.0.3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
Expand All @@ -186,9 +190,9 @@ GEM
rack
railties (>= 5.1)
semantic_logger (~> 4.9)
railties (7.0.2.3)
actionpack (= 7.0.2.3)
activesupport (= 7.0.2.3)
railties (7.0.3)
actionpack (= 7.0.3)
activesupport (= 7.0.3)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand All @@ -198,7 +202,7 @@ GEM
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.2.1)
regexp_parser (2.5.0)
rexml (3.2.5)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
Expand All @@ -208,7 +212,7 @@ GEM
rspec-mocks (3.11.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-rails (5.1.1)
rspec-rails (5.1.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
railties (>= 5.2)
Expand All @@ -217,37 +221,38 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.11.0)
rubocop (1.26.1)
rubocop (1.29.1)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.16.0, < 2.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.17.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.16.0)
rubocop-ast (1.18.0)
parser (>= 3.1.1.0)
rubocop-performance (1.13.3)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-next-core (0.15.1)
ruby-progressbar (1.11.0)
semantic_logger (4.10.0)
semantic_logger (4.11.0)
concurrent-ruby (~> 1.0)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
standard (1.9.1)
rubocop (= 1.26.1)
standard (1.12.1)
rubocop (= 1.29.1)
rubocop-performance (= 1.13.3)
standardrb (1.0.1)
standard
strscan (3.0.1)
strscan (3.0.3)
thor (1.2.1)
timeout (0.2.0)
timeout (0.3.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
unicode-display_width (2.1.0)
Expand All @@ -258,6 +263,23 @@ GEM
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
yabeda (0.11.0)
anyway_config (>= 1.0, < 3)
concurrent-ruby
dry-initializer
yabeda-prometheus (0.8.0)
prometheus-client (>= 0.10, < 3.0)
rack
yabeda (~> 0.10)
yabeda-puma-plugin (0.6.0)
json
puma
yabeda (~> 0.5)
yabeda-rails (0.8.1)
activesupport
anyway_config (>= 1.3, < 3)
railties
yabeda (~> 0.8)
zeitwerk (2.5.4)

PLATFORMS
Expand All @@ -274,7 +296,6 @@ DEPENDENCIES
jbuilder (~> 2.7)
listen (~> 3.3)
mysql2 (~> 0.5)
prometheus-client
puma (~> 5.0)
rails (~> 7.0.0)
rails_semantic_logger
Expand All @@ -283,6 +304,9 @@ DEPENDENCIES
standardrb
tzinfo-data
webmock
yabeda-prometheus
yabeda-puma-plugin
yabeda-rails

BUNDLED WITH
2.3.7
15 changes: 0 additions & 15 deletions app/controllers/test_controller.rb

This file was deleted.

5 changes: 0 additions & 5 deletions config.ru
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# This file is used by Rack-based servers to start the application.

require_relative "config/environment"
require "prometheus/middleware/collector"
require "prometheus/middleware/exporter"

use Prometheus::Middleware::Collector
use Prometheus::Middleware::Exporter

run Rails.application
Rails.application.load_server
4 changes: 4 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ class Application < Rails::Application
config.rails_semantic_logger.rendered = true
config.colorize_logging = false
config.time_zone = "Eastern Time (US & Canada)"
Yabeda.configure do
gauge :checkout_history_load_last_success, comment: "Time that the circ history load last succeeded"
gauge :checkout_history_num_items_loaded, comment: "Number of items loaded into the checkout history database"
end
end
end
Loading

0 comments on commit c60e508

Please sign in to comment.