Merge pull request #1112 from basecamp/flavorjones/yabeda-puma
Introduce yabeda for puma metrics
This commit is contained in:
@@ -40,8 +40,10 @@ gem "sentry-ruby"
|
||||
gem "sentry-rails"
|
||||
gem "rails_structured_logging", bc: "rails-structured-logging"
|
||||
gem "yabeda"
|
||||
gem "prometheus-client-mmap", "~> 1.1"
|
||||
gem "yabeda-rails"
|
||||
gem "yabeda-puma-plugin"
|
||||
gem "yabeda-prometheus-mmap"
|
||||
gem "prometheus-client-mmap", "~> 1.1"
|
||||
|
||||
# AI
|
||||
gem "ruby_llm", git: "https://github.com/crmne/ruby_llm.git"
|
||||
|
||||
@@ -623,6 +623,15 @@ GEM
|
||||
yabeda-prometheus-mmap (0.4.0)
|
||||
prometheus-client-mmap
|
||||
yabeda (~> 0.10)
|
||||
yabeda-puma-plugin (0.7.1)
|
||||
json
|
||||
puma
|
||||
yabeda (~> 0.5)
|
||||
yabeda-rails (0.10.0)
|
||||
activesupport
|
||||
anyway_config (>= 1.3, < 3)
|
||||
railties
|
||||
yabeda (~> 0.8)
|
||||
zeitwerk (2.7.3)
|
||||
|
||||
PLATFORMS
|
||||
@@ -688,6 +697,8 @@ DEPENDENCIES
|
||||
webmock
|
||||
yabeda
|
||||
yabeda-prometheus-mmap
|
||||
yabeda-puma-plugin
|
||||
yabeda-rails
|
||||
|
||||
BUNDLED WITH
|
||||
2.7.0
|
||||
|
||||
@@ -2,6 +2,7 @@ require "prometheus/client/support/puma"
|
||||
|
||||
Prometheus::Client.configuration.logger = Rails.logger
|
||||
Prometheus::Client.configuration.pid_provider = Prometheus::Client::Support::Puma.method(:worker_pid_provider)
|
||||
Yabeda::Rails.config.controller_name_case = :camel
|
||||
|
||||
require "yabeda/solid_queue"
|
||||
Yabeda::SolidQueue.install!
|
||||
|
||||
@@ -22,3 +22,19 @@ plugin :tmp_restart
|
||||
|
||||
# Run Solid Queue with Puma
|
||||
plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
|
||||
|
||||
if ENV.fetch("PREFORK") { !Rails.env.local? }
|
||||
on_worker_boot do
|
||||
Yabeda::ActiveRecord.start_timed_metric_collection_task
|
||||
Hey.deployment.start_timed_report_host_refresh
|
||||
end
|
||||
|
||||
# Expose prometheus metrics on port 9394
|
||||
activate_control_app
|
||||
plugin :yabeda
|
||||
plugin :yabeda_prometheus
|
||||
|
||||
before_fork do
|
||||
Process.warmup
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user