Add fluentd_enable_watch_timer

By default, the watch timer in Fluentd is set to True.
To save CPU and I/O consumption this can be set to False, which
kolla-ansible has been hardcoding so far.

When the watch timer is disabled, in_tail relies entirely
on inotify. In certain constellations, this may not work
reliably. In these cases, the watch timer needs to be activated, so this
change adds a variable to make the setting configurable.

Change-Id: Ic8ce6fbc3ed8f31d5d090e114b35703532679729
This commit is contained in:
Christian Berendt 2021-04-08 08:40:23 +02:00 committed by Dr. Jens Harbott
parent 2c15d36fed
commit 110686e693
8 changed files with 22 additions and 8 deletions

View File

@ -127,6 +127,9 @@ cron_logrotate_schedule: "daily"
# Fluentd
####################
# Enable the additional watch timer
fluentd_enable_watch_timer: "false"
fluentd_input_openstack_services:
- name: aodh
enabled: "{{ enable_aodh | bool }}"

View File

@ -14,7 +14,7 @@
pos_file /var/run/td-agent/kolla-openstack.pos
tag kolla.*
ignore_repeated_permission_error true
enable_watch_timer false
enable_watch_timer {{ fluentd_enable_watch_timer }}
<parse>
@type multiline
format_firstline /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3} \d+ \S+ \S+ \[(req-\S+ \S+ \S+ \S+ \S+ \S+|-)\]/

View File

@ -5,7 +5,7 @@
path /var/log/kolla/mariadb/mariadb.log
pos_file /var/run/td-agent/mariadb.pos
tag infra.mariadb
enable_watch_timer false
enable_watch_timer {{ fluentd_enable_watch_timer }}
<parse>
@type multiline
format_firstline /^(\d{4}-\d{2}-\d{2}|\d{6}) /
@ -18,7 +18,7 @@
pos_file /var/run/td-agent/mariadb-xinetd.pos
tag infra.mariadb-xinetd
ignore_repeated_permission_error true
enable_watch_timer false
enable_watch_timer {{ fluentd_enable_watch_timer }}
<parse>
@type multiline
format_firstline /^\d{2}/\d{1,2}/\d{1,2}@\d{1,2}:\d{1,2}:\d{1,2}\: (START|EXIT)\: /

View File

@ -3,7 +3,7 @@
path /var/log/kolla/rabbitmq/rabbit@{{ ansible_facts.hostname }}.log
pos_file /var/run/td-agent/rabbit.pos
tag infra.rabbit
enable_watch_timer false
enable_watch_timer {{ fluentd_enable_watch_timer }}
<parse>
@type multiline
format_firstline /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}/

View File

@ -4,7 +4,7 @@
path /var/log/kolla/*/*-access.log,/var/log/kolla/*/*-error.log,/var/log/kolla/*/*_access.log,/var/log/kolla/*/*_error.log
pos_file /var/run/td-agent/kolla-openstack-wsgi.pos
tag kolla.*
enable_watch_timer false
enable_watch_timer {{ fluentd_enable_watch_timer }}
<parse>
@type regexp
expression /^(?<Payload>.*)$/

View File

@ -3,7 +3,7 @@
path /var/log/kolla/libvirt/libvirtd.log
pos_file /var/run/td-agent/libvirt.pos
tag infra.libvirt
enable_watch_timer false
enable_watch_timer {{ fluentd_enable_watch_timer }}
<parse>
@type regexp
expression /^(?<Timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}\+\d{4}): (?<Pid>\d+): (?<log_level>\S+) : (?<Payload>.*)?$/

View File

@ -3,7 +3,7 @@
path /var/log/kolla/openvswitch/ovs-vswitchd.log
pos_file /var/run/td-agent/openvswitch.pos
tag infra.openvswitch
enable_watch_timer false
enable_watch_timer {{ fluentd_enable_watch_timer }}
<parse>
@type multiline
format_firstline /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}/
@ -18,7 +18,7 @@
path /var/log/kolla/openvswitch/ovsdb-server.log
pos_file /var/run/td-agent/openvswitchdb.pos
tag infra.openvswitchdb
enable_watch_timer false
enable_watch_timer {{ fluentd_enable_watch_timer }}
<parse>
@type multiline
format_firstline /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}/

View File

@ -0,0 +1,11 @@
---
features:
- |
With the boolean parameter ``fluentd_enable_watch_timer`` it is
now possible to enable the additional watch timer of Fluentd.
The default value of ``fluentd_enable_watch_timer`` is set
to ``false``.
More details about the watch timer in Fluentd can be found at
https://docs.fluentd.org/input/tail#enable_watch_timer.