File tree Expand file tree Collapse file tree 5 files changed +109
-1
lines changed
Expand file tree Collapse file tree 5 files changed +109
-1
lines changed Original file line number Diff line number Diff line change 1+ #
2+ # Copyright StackHPC, 2018
3+ #
4+ ---
5+ - name : Deploy Swarm cluster monitoring
6+ hosts : cluster
7+ become : yes
8+ roles :
9+ - role : monasca_fluentd
10+
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ alaska_cloud: alaska
1515alaska_homedir: /alaska
1616alaska_softiron: 10.4.99.101
1717
18- # OpenStack fully qualified project name
18+ # OpenStack fully qualified project name (used for Grafana with domain support)
1919project_name: p3@default
2020
2121# Virtual IP address of the controller node
@@ -28,6 +28,14 @@ alaska_monitoring_server: 10.60.253.3
2828monasca_agent_p3_username: p3-monasca-agent
2929monasca_agent_p3_password: "{{ vault_monasca_agent_password }}"
3030
31+ # Monasca Fluentd config
32+ monasca_fluentd_log_api_uri: http://{{ controller_vip }}:5607
33+ monasca_fluentd_keystone_uri: http://{{ controller_vip }}:5000
34+ monasca_fluentd_username: "{{ monasca_agent_p3_username }}"
35+ monasca_fluentd_password: "{{ monasca_agent_p3_password }}"
36+ monasca_fluentd_project_domain_id: default
37+ monasca_fluentd_project_name: p3
38+
3139# Local Grafana admin account for configuring Grafana
3240grafana_admin_username: grafana-admin
3341grafana_admin_password: "{{ vault_grafana_admin_password }}"
Original file line number Diff line number Diff line change 1+ ---
2+ - name : Restart Fluentd
3+ docker_container :
4+ name : fluentd
5+ restart : True
6+ when : fluentd_config.changed
Original file line number Diff line number Diff line change 1+ #
2+ # Copyright StackHPC, 2018
3+ #
4+ ---
5+ - name : Create Fluentd user
6+ user :
7+ name : fluent
8+ state : present
9+
10+ - name : Create Fluentd config directory
11+ file :
12+ path : /etc/fluentd
13+ state : directory
14+ owner : fluent
15+ group : fluent
16+ mode : 0755
17+
18+ - name : Generate Fluentd config
19+ template :
20+ src : fluentd.conf.j2
21+ dest : /etc/fluentd/fluentd.conf
22+ owner : fluent
23+ group : fluent
24+ mode : 0644
25+ register : fluentd_config
26+ notify : Restart Fluentd
27+
28+ - name : Start Fluentd container
29+ docker_container :
30+ name : fluentd
31+ image : stackhpc/monasca-fluentd:latest
32+ state : started
33+ ports :
34+ - " 24224:24224"
35+ - " 24224:24224/udp"
36+ volumes :
37+ - /etc/fluentd/:/fluentd/etc:ro
38+ env :
39+ FLUENTD_CONF : " fluentd.conf"
Original file line number Diff line number Diff line change 1+ # Accept logs from Docker Fluentd log driver
2+ <source >
3+ @type forward
4+ port 24224
5+ bind 0.0.0.0
6+ </source >
7+
8+ # Add a timestamp dimension to all logs to record the event time. The
9+ # event time is the time extracted from the log message in all cases
10+ # where the time_key is set, and the time the record entered fluentd
11+ # if no time_key is set.
12+ # logs.
13+ <filter *.** >
14+ @type record_transformer
15+ <record >
16+ timestamp ${time}
17+ </record >
18+ </filter >
19+
20+ # Docker saves all logs under the 'log' field. The fluentd-monasca
21+ # plugin assumes that they are saved under the 'message' field. Here
22+ # we map the 'log' field to the 'message' field for all logs.
23+ <filter *.** >
24+ @type record_transformer
25+ enable_ruby true
26+ <record >
27+ message ${record["log"]}
28+ </record >
29+ remove_keys log
30+ </filter >
31+
32+ <match *.** >
33+ type copy
34+ <store >
35+ @type monasca
36+ keystone_url {{ monasca_fluentd_keystone_uri }}
37+ monasca_log_api {{ monasca_fluentd_log_api_uri }}
38+ monasca_log_api_version v3.0
39+ username {{ monasca_fluentd_username }}
40+ password {{ monasca_fluentd_password }}
41+ domain_id {{ monasca_fluentd_project_domain_id }}
42+ project_name {{ monasca_fluentd_project_name }}
43+ </store >
44+ </match >
45+
You can’t perform that action at this time.
0 commit comments