lib/splash/daemon/metrics.rb in prometheus-splash-0.6.0 vs lib/splash/daemon/metrics.rb in prometheus-splash-0.6.1
- old
+ new
@@ -74,21 +74,21 @@
# Send metrics to Prometheus PushGateway
# @return [Hash] Exiter case ( :service_dependence_missing , :quiet_exit)
def notify
log = get_logger
session = get_session
- unless verify_service host: @config.prometheus_pushgateway_host ,port: @config.prometheus_pushgateway_port then
+ unless verify_service url: @config.prometheus_pushgateway_url then
return { :case => :service_dependence_missing, :more => "Prometheus Notification not send." }
end
log.debug "Sending Splash self metrics to PushGateway." , session
@metric_uptime.set uptime
@metric_execution.set execution_count
@metric_logs_monitoring.set monitoring_logs_count
@metric_processes_monitoring.set monitoring_processes_count
hostname = Socket.gethostname
- url = "http://#{@config.prometheus_pushgateway_host}:#{@config.prometheus_pushgateway_port}/#{@config.prometheus_pushgateway_path}"
+ url = @config.prometheus_pushgateway_url
Prometheus::Client::Push.new('Splash',hostname, url).add(@registry)
log.debug "Sending to Prometheus PushGateway done.", session
return {:case => :quiet_exit }
end