Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Yabeda server in a new process #22

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove unneeded change
Josh Etsenake committed Nov 10, 2022
commit 82d277541c5920d7cca286cfa5308bd7822d94c1
4 changes: 2 additions & 2 deletions lib/yabeda/prometheus/exporter.rb
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@ def start_server_in_thread!(**rack_app_options)
end
end

def rack_app(exporter = self, logger: Logger.new(IO::NULL), use_deflater: true, **exporter_options)
def start_server_in_process!(**rack_app_options)
pid = Process.fork do
# re-configure yabeda since we're in a new process
@@ -43,8 +42,9 @@ def start_server_in_process!(**rack_app_options)
Process.detach(pid) if pid
end

def rack_app(exporter = self, path: "/metrics", logger: Logger.new(IO::NULL))
def rack_app(exporter = self, logger: Logger.new(IO::NULL), use_deflater: true, **exporter_options)
::Rack::Builder.new do
use ::Rack::Deflater if use_deflater
etsenake marked this conversation as resolved.
Show resolved Hide resolved
use ::Rack::CommonLogger, logger
use ::Rack::ShowExceptions
use exporter, **exporter_options