config.ru does not depend on yaml anymore. comments for registry=
This commit is contained in:
parent
9817156b7a
commit
8bf674fa55
|
@ -1,7 +1,6 @@
|
||||||
# vim: set noet sw=2 ts=2 sts=2:
|
# vim: set noet sw=2 ts=2 sts=2:
|
||||||
require 'rack'
|
require 'rack'
|
||||||
require_relative 'dnsbl_exporter'
|
require_relative 'dnsbl_exporter'
|
||||||
require 'yaml'
|
|
||||||
|
|
||||||
DnsblCollector.load_config './config.yml'
|
DnsblCollector.load_config './config.yml'
|
||||||
|
|
||||||
|
@ -26,7 +25,7 @@ run lambda {|env|
|
||||||
[404, {"Content-Type" => "text/plain"}, ["Not found.\nYou want to try /metrics?\n"]]
|
[404, {"Content-Type" => "text/plain"}, ["Not found.\nYou want to try /metrics?\n"]]
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
STDERR.puts "#$! (#{$!.class})", $!.backtrace
|
STDERR.puts "#$! (#{$!.class})", *$!.backtrace
|
||||||
[500, {"Content-Type" => "text/plain"}, ["Server-error.\n"]]
|
[500, {"Content-Type" => "text/plain"}, ["Server-error.\n"]]
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,8 +43,11 @@ class DnsblCollector
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# The general Registry for the process.
|
||||||
|
# It stores not request-related metrices.
|
||||||
self.registry = Prometheus::Client::Registry.new
|
self.registry = Prometheus::Client::Registry.new
|
||||||
|
|
||||||
|
# @registry stores only request-related metrices.
|
||||||
attr_reader :lists, :registry, :configfile, :resolver, :metrics
|
attr_reader :lists, :registry, :configfile, :resolver, :metrics
|
||||||
|
|
||||||
def initialize registry: nil
|
def initialize registry: nil
|
||||||
|
|
Loading…
Reference in a new issue