Add telegraf agent to mariadb pod

Change-Id: I5d730e9ad792735ef33d29fa33916f5b7d7c2b06
This commit is contained in:
Bartosz Kupidura 2017-01-24 12:22:44 +01:00
parent 369b9116d7
commit 40b2323bbb
2 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,27 @@
[agent]
interval = "15s"
round_interval = false
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "2s"
hostname = ""
omit_hostname = false
[[outputs.prometheus_client]]
listen = ":{{ telegraf.prometheus_output_port.cont }}"
[[inputs.mysql]]
servers = ["root:{{ db.root_password }}@tcp({{ network_topology["private"]["address"] }}:{{ mariadb.port.cont }})/"]
table_schema_databases = []
gather_table_schema = true
gather_process_list = true
gather_info_schema_auto_inc = false
gather_slave_status = false
gather_binary_logs = true
gather_table_io_waits = true
gather_table_lock_waits = true
gather_index_io_waits = true
gather_event_waits = true
gather_file_events_stats = true
gather_perf_events_statements = true
interval_slow = "10m"

View File

@ -1,8 +1,14 @@
dsl_version: 0.1.0
dsl_version: 0.4.0
service:
name: {{ service.database }}
ports:
- {{ mariadb.port }}
# {% if telegraf is defined %}
annotations:
service:
prometheus.io/scrape: "true"
prometheus.io/port: "{{ telegraf.prometheus_output_port.cont }}"
# {% endif %}
containers:
- name: mariadb
image: mariadb
@ -28,6 +34,18 @@ service:
- mariadb-readiness
- mariadb-bootstrap
- mariadb-security-reset.expect
# {% if telegraf is defined %}
- name: mariadb-telegraf
image: telegraf
daemon:
dependencies:
- etcd
- mariadb
command: telegraf --config /etc/telegraf/telegraf.conf --input-filter mysql
files:
- telegraf-conf
# {% endif %}
files:
mariadb-my-cnf:
path: /etc/mysql/my.cnf
@ -44,3 +62,6 @@ files:
path: /opt/ccp/bin/mariadb-security-reset.expect
content: mariadb-security-reset.expect
perm: "755"
telegraf-conf:
path: /etc/telegraf/telegraf.conf
content: telegraf.conf.j2