diff --git a/cookbooks/prometheus/files/etc/logrotate.d/prometheus b/cookbooks/prometheus/files/etc/logrotate.d/prometheus new file mode 100644 index 0000000..d9fd673 --- /dev/null +++ b/cookbooks/prometheus/files/etc/logrotate.d/prometheus @@ -0,0 +1,13 @@ +/var/log/prometheus.log +{ + rotate 4 + weekly + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + /usr/lib/rsyslog/rsyslog-rotate + endscript +} diff --git a/cookbooks/prometheus/prometheus_setup.rb b/cookbooks/prometheus/prometheus_setup.rb index bda685c..ab8a564 100644 --- a/cookbooks/prometheus/prometheus_setup.rb +++ b/cookbooks/prometheus/prometheus_setup.rb @@ -44,6 +44,13 @@ service 'rsyslog' do action :nothing end +# Depoy `logrotate` configuration for `prometheus`: +remote_file '/etc/logrotate.d/prometheus' do + owner 'root' + group 'root' + mode '644' +end + # Depoy `consul` service configuration for `prometheus`: remote_file '/etc/consul.d/service-prometheus.json' do owner 'consul'