Currently, it is set to notifies :restart, 'service[prometheus]', :delayed, which isn't recommended. Further documentation is provided here. Instead, I recommend to do it this way:
# Create Prometheus configuration yml file
template '/path/to/prometheus.yml do
owner node['prometheus']['user']
group node['prometheus']['group']
mode '0644'
source 'prometheus.yml.erb'
notifies :run, 'execute[reload_prometheus]', :delayed
end
# Reload Prometheus if configuration yml is created or modified
execute 'reload_prometheus' do
user 'root
group 'root
cwd '/opt/prometheus'
command 'curl -X POST 127.0.0.1:9090/-/reload'
action :nothing
end
Currently, it is set to
notifies :restart, 'service[prometheus]', :delayed
, which isn't recommended. Further documentation is provided here. Instead, I recommend to do it this way:Food for thought