-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: split elastic_beat into core_filebeat, metricbeat and dashm…
…ate (#658) * refactor: split elastic_beat into core_filebeat, metricbeat and dashmate * refactor: use FQN and remove temp role * refactor: reuse filebeat config * fix: hosts * fix: hosts 2 * fix: start kibana only on logs-1 * fix: select host nodes * fix: filebeat_inputs.yml not found * fix: reading logs from gzip * fix: tenderdash indexing gz * fix: indexing old data * refactor: remove unused exclude
- Loading branch information
Showing
15 changed files
with
263 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
|
||
core_container_name: "dashd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
|
||
- name: Load common filebeat config | ||
ansible.builtin.include_vars: | ||
file: common.yml | ||
|
||
- name: Get core container host info | ||
community.docker.docker_host_info: | ||
containers: true | ||
containers_filters: | ||
name: '{{ core_container_name }}' | ||
register: core_host_info | ||
|
||
- name: Set container ids for core if core is running | ||
ansible.builtin.set_fact: | ||
core_container_id: '{{ core_host_info.containers[0].Id }}' | ||
when: core_host_info.containers | length > 0 | ||
|
||
- name: Load core input config if core is running | ||
ansible.builtin.include_vars: | ||
file: core.yml | ||
when: core_container_id is defined | ||
|
||
- name: Set up filebeat log monitoring | ||
ansible.builtin.include_role: | ||
name: geerlingguy.filebeat | ||
|
||
- name: Make sure filebeat is restarted | ||
ansible.builtin.service: | ||
name: filebeat | ||
state: restarted | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
|
||
- name: Create logs dir | ||
ansible.builtin.file: | ||
path: '{{ dashmate_logs_dir }}' | ||
state: directory | ||
owner: '{{ dashmate_user }}' | ||
group: '{{ dashmate_group }}' | ||
recurse: true | ||
|
||
- name: Configure log rotation | ||
ansible.builtin.include_role: | ||
name: arillso.logrotate | ||
vars: | ||
logrotate_applications: | ||
- name: platform-logs | ||
definitions: | ||
- logs: | ||
- '{{ dashmate_logs_dir }}/*.log' | ||
options: | ||
- rotate 7 | ||
- daily | ||
- maxsize 1G | ||
- missingok | ||
- notifempty | ||
- copytruncate | ||
- compress | ||
- delaycompress | ||
|
||
- name: Ensure logrotate runs hourly under systemd timer | ||
ansible.builtin.lineinfile: | ||
path: /lib/systemd/system/logrotate.timer | ||
regexp: '^OnCalendar=hourly' | ||
insertafter: '^OnCalendar=daily' | ||
line: OnCalendar=hourly | ||
|
||
- name: Load common filebeat config | ||
ansible.builtin.include_vars: | ||
file: "{{ role_path }}/../core_filebeat/vars/common.yml" | ||
|
||
- name: Load filebeat inputs | ||
ansible.builtin.include_vars: | ||
file: filebeat_inputs.yml | ||
|
||
- name: Set up filebeat log monitoring | ||
ansible.builtin.include_role: | ||
name: geerlingguy.filebeat | ||
|
||
- name: Make sure filebeat is restarted | ||
ansible.builtin.service: | ||
name: filebeat | ||
state: restarted | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
|
||
filebeat_inputs: | ||
- type: log | ||
enabled: true | ||
index: "logs-core-{{ dash_network_name }}-%{[agent.version]}" | ||
paths: | ||
- "{{ dashmate_logs_dir }}/core.log" | ||
processors: | ||
- add_fields: | ||
target: event | ||
fields: | ||
dataset: "core-{{ dash_network_name }}" | ||
- dissect: | ||
tokenizer: "%{?timestamp} %{message}" | ||
overwrite_keys: true | ||
target_prefix: "" | ||
- type: log | ||
enabled: "{{ dashmate_platform_enable }}" | ||
json.message_key: message | ||
index: "logs-drive.abci-{{ dash_network_name }}-%{[agent.version]}" | ||
paths: | ||
- "{{ dashmate_logs_dir }}/drive-json.log" | ||
processors: | ||
- timestamp: | ||
field: json.timestamp | ||
layouts: | ||
- UNIX_MS | ||
- add_fields: | ||
target: event | ||
fields: | ||
dataset: "drive.abci-{{ dash_network_name }}" | ||
- rename: | ||
fields: | ||
- from: "json.fields.message" | ||
to: "message" | ||
- from: "json.level" | ||
to: "log.level" | ||
ignore_missing: true | ||
fail_on_error: true | ||
- type: log | ||
enabled: "{{ dashmate_platform_enable }}" | ||
json.message_key: message | ||
index: "logs-drive.tenderdash-{{ dash_network_name }}-%{[agent.version]}" | ||
paths: | ||
- "{{ dashmate_logs_dir }}/tenderdash.log" | ||
processors: | ||
- add_fields: | ||
target: event | ||
fields: | ||
dataset: "drive.tenderdash-{{ dash_network_name }}" | ||
- rename: | ||
fields: | ||
- from: "json.message" | ||
to: "message" | ||
ignore_missing: true | ||
fail_on_error: true | ||
- rename: | ||
fields: | ||
- from: "json.level" | ||
to: "log.level" |
Oops, something went wrong.