lib/sidekiq/prometheus/exporter.rb in sidekiq-prometheus-exporter-0.2.0 vs lib/sidekiq/prometheus/exporter.rb in sidekiq-prometheus-exporter-0.2.1
- old
+ new
@@ -9,13 +9,14 @@
module Exporter
REQUEST_VERB = 'GET'.freeze
REQUEST_METHOD = 'REQUEST_METHOD'.freeze
NOT_FOUND_TEXT = 'Not Found'.freeze
MOUNT_PATH = '/metrics'.freeze
- # rubocop:disable Style/MutableConstant
- HEADERS = {Rack::CONTENT_TYPE => 'text/plain; version=0.0.4', Rack::CACHE_CONTROL => 'no-cache'}
- # rubocop:enable Style/MutableConstant
+ HEADERS = {
+ Rack::CONTENT_TYPE => 'text/plain; version=0.0.4',
+ Rack::CACHE_CONTROL => 'no-cache'
+ }.freeze
EXPORTERS = Exporters.new
class << self
def banner
exporters =
@@ -45,10 +46,10 @@
end
def call(env)
return [404, HEADERS, [NOT_FOUND_TEXT]] if env[REQUEST_METHOD] != REQUEST_VERB
- [200, HEADERS, [EXPORTERS.to_s]]
+ [200, HEADERS.dup, [EXPORTERS.to_s]]
end
end
end
end
end