Skip to content

Commit

Permalink
remove rack deflater changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Etsenake committed Nov 10, 2022
1 parent 3a9479a commit 0bd3421
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions lib/yabeda/prometheus/exporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,23 @@ 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), use_deflater: false)
def rack_app(exporter = self, path: "/metrics", logger: Logger.new(IO::NULL))
::Rack::Builder.new do
use ::Rack::Deflater if use_deflater
use ::Rack::CommonLogger, logger
use ::Rack::ShowExceptions
use exporter, **exporter_options
run NOT_FOUND_HANDLER
end
end

def start_app(raise_start_error: true, **rack_app_options)
def start_app(**rack_app_options)
default_port = ENV.fetch("PORT", 9394)
::Rack::Handler::WEBrick.run(
rack_app(**rack_app_options),
Host: ENV["PROMETHEUS_EXPORTER_BIND"] || "0.0.0.0",
Port: ENV.fetch("PROMETHEUS_EXPORTER_PORT", default_port),
AccessLog: [],
)
rescue Errno::EADDRINUSE
puts "Yabeda prometheus exporter: Failed to start, server might be started by another process"
raise if raise_start_error
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/yabeda/prometheus/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Yabeda
module Prometheus
VERSION = "0.9.0"
VERSION = "0.8.0"
end
end

0 comments on commit 0bd3421

Please sign in to comment.