|
57 | 57 | - name: Set up filebeat log monitoring
|
58 | 58 | ansible.builtin.include_role:
|
59 | 59 | name: geerlingguy.filebeat
|
| 60 | + |
| 61 | +# TODO: Make sure we have retention policy for metrics |
| 62 | +- name: Set up metricbeat |
| 63 | + ansible.builtin.include_role: |
| 64 | + name: elastic.beats |
| 65 | + vars: |
| 66 | + beats_version: "{{ elastic_version }}" |
| 67 | + beat: metricbeat |
| 68 | + beat_conf: |
| 69 | + setup: |
| 70 | + dashboards: |
| 71 | + enabled: true |
| 72 | + kibana: |
| 73 | + host: "{{ hostvars['logs-1'].private_ip }}:5601" |
| 74 | + username: "{{ elastic_username }}" |
| 75 | + password: "{{ elastic_password }}" |
| 76 | + metricbeat: |
| 77 | + modules: |
| 78 | + - module: system |
| 79 | + metricsets: |
| 80 | + - cpu # CPU usage |
| 81 | + - load # CPU load averages |
| 82 | + - memory # Memory usage |
| 83 | + - network # Network IO |
| 84 | + - process # Per process metrics |
| 85 | + - process_summary # Process summary |
| 86 | + - uptime # System Uptime |
| 87 | + - socket_summary # Socket summary |
| 88 | + - core # Per CPU core usage |
| 89 | + - diskio # Disk IO |
| 90 | + - fsstat # File system summary metrics |
| 91 | + - socket # Sockets and connection info (linux only) |
| 92 | + enabled: true |
| 93 | + period: 10s |
| 94 | + processes: ['.*'] |
| 95 | + |
| 96 | + # Configure the metric types that are included by these metricsets. |
| 97 | + cpu.metrics: ["percentages", "normalized_percentages"] # The other available option is ticks. |
| 98 | + core.metrics: ["percentages"] # The other available option is ticks. |
| 99 | + - module: docker |
| 100 | + metricsets: |
| 101 | + - "container" |
| 102 | + - "cpu" |
| 103 | + - "diskio" |
| 104 | + - "event" |
| 105 | + - "healthcheck" |
| 106 | + - "info" |
| 107 | + - "memory" |
| 108 | + - "network" |
| 109 | + # - "network_summary" |
| 110 | + hosts: ["unix:///var/run/docker.sock"] |
| 111 | + period: 10s |
| 112 | + enabled: true |
| 113 | + output_conf: |
| 114 | + elasticsearch: |
| 115 | + hosts: |
| 116 | + - "{{ hostvars['logs-1'].private_ip }}:9200" |
| 117 | + username: "{{ elastic_username }}" |
| 118 | + password: "{{ elastic_password }}" |
0 commit comments