From 5293b1294f5a67107f247f462840ef145bf2ef44 Mon Sep 17 00:00:00 2001 From: Doug Szumski Date: Wed, 19 Jun 2019 11:27:14 +0000 Subject: [PATCH] Enable buffering to file for Monasca logs This enables buffering to file, rather than memory for Monasca logs. A dedicated docker volume is used for the file buffer. If a post to the Monasca Log API fails, retries will be made using an exponential backoff algorithm with a maximum retry interval of 30mins. The maximum interval is set relatively low to try and reduce the risk of large buffers accumulating, and therefore the risk of overloading the Monasca Log API. Closes-Bug: #1855700 Change-Id: Ib5286e9dbaf2bc92d2f4960b2131223ab5dbdbec --- ansible/roles/common/templates/conf/output/00-local.conf.j2 | 6 ++++++ .../roles/common/templates/conf/output/02-monasca.conf.j2 | 3 +++ ...buffering-to-file-for-monasca-logs-88ca66cc4d6cda3b.yaml | 5 +++++ 3 files changed, 14 insertions(+) create mode 100644 releasenotes/notes/enable-buffering-to-file-for-monasca-logs-88ca66cc4d6cda3b.yaml diff --git a/ansible/roles/common/templates/conf/output/00-local.conf.j2 b/ansible/roles/common/templates/conf/output/00-local.conf.j2 index f9753eb9d6..22597cb401 100644 --- a/ansible/roles/common/templates/conf/output/00-local.conf.j2 +++ b/ansible/roles/common/templates/conf/output/00-local.conf.j2 @@ -40,6 +40,9 @@ domain_id default project_name {{ monasca_control_plane_project }} message_field_name Payload + buffer_type file + buffer_path /var/lib/fluentd/data/monasca.buffer/{{ syslog_swift_facility }}.* + max_retry_wait 1800s {% endif %} @@ -88,6 +91,9 @@ domain_id default project_name {{ monasca_control_plane_project }} message_field_name Payload + buffer_type file + buffer_path /var/lib/fluentd/data/monasca.buffer/{{ syslog_haproxy_facility }}.* + max_retry_wait 1800s {% endif %} diff --git a/ansible/roles/common/templates/conf/output/02-monasca.conf.j2 b/ansible/roles/common/templates/conf/output/02-monasca.conf.j2 index dad304e6c1..88039b4360 100644 --- a/ansible/roles/common/templates/conf/output/02-monasca.conf.j2 +++ b/ansible/roles/common/templates/conf/output/02-monasca.conf.j2 @@ -10,5 +10,8 @@ domain_id default project_name {{ monasca_control_plane_project }} message_field_name Payload + buffer_type file + buffer_path /var/lib/fluentd/data/monasca.buffer/openstack.* + max_retry_wait 1800s diff --git a/releasenotes/notes/enable-buffering-to-file-for-monasca-logs-88ca66cc4d6cda3b.yaml b/releasenotes/notes/enable-buffering-to-file-for-monasca-logs-88ca66cc4d6cda3b.yaml new file mode 100644 index 0000000000..48ec8f1129 --- /dev/null +++ b/releasenotes/notes/enable-buffering-to-file-for-monasca-logs-88ca66cc4d6cda3b.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Fluentd now buffers logs locally to file when the Monasca API is + unreachable.