diff --git a/cookbooks/prometheus/files/etc/rsyslog.d/30-prometheus.conf b/cookbooks/prometheus/files/etc/rsyslog.d/30-prometheus.conf new file mode 100644 index 0000000..01b30bb --- /dev/null +++ b/cookbooks/prometheus/files/etc/rsyslog.d/30-prometheus.conf @@ -0,0 +1,7 @@ +# Log kernel generated digdag log messages to file +:syslogtag,contains,"prometheus" /var/log/prometheus.log + +# Uncomment the following to stop logging anything that matches the last rule. +# Doing this will stop logging kernel generated UFW log messages to the file +# normally containing kern.* messages (eg, /var/log/kern.log) +& stop diff --git a/cookbooks/prometheus/prometheus_setup.rb b/cookbooks/prometheus/prometheus_setup.rb index d9e95a4..3eb79b7 100644 --- a/cookbooks/prometheus/prometheus_setup.rb +++ b/cookbooks/prometheus/prometheus_setup.rb @@ -8,7 +8,7 @@ end %w(/etc/prometheus.d).each do |d| directory d do owner 'prometheus' - group 'promtheus' + group 'prometheus' mode '0755' end end @@ -20,13 +20,15 @@ remote_file '/etc/prometheus.d/prometheus.yml' do mode '644' end -# Deploy `supervisor` configuration for `prometheus`: -remote_file '/etc/supervisor/conf.d/prometheus.conf' do - owner 'prometheus' - group 'prometheus' +# Deploy `systemd` configuration for `prometheus`: +remote_file '/etc/systemd/system/prometheus.service' do + owner 'root' + group 'root' mode '644' +end - notifies :restart, 'service[supervisor]' +service 'prometheus' do + action [:enable, :start] end # Depoy `consul` service configuration for `prometheus`: