infrastructure/roles/gitlab/templates/telegraf.conf
saibotk f62d1682e9
gitlab: Add telegraf integration
This patch adds a telegraf client to the gitlab role, that can be
activated by defining `gitlab_telegraf`. It allows to collect all
prometheus metric with telegraf and store them in influxDB.

This is an experimental feature.

Authored by: Sheogorath
Co-authored-by: Sheogorath <sheogorath@shivering-isles.com>
2021-03-28 02:43:51 +01:00

26 lines
828 B
Text

{{ ansible_managed | comment }}
[global_tags]
[agent]
interval = "10s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 1000000
collection_jitter = "5s"
flush_interval = "10s"
flush_jitter = "5s"
precision = ""
hostname = "{{ ansible_fqdn }}"
omit_hostname = false
[[outputs.influxdb]]
urls = ["https://{{ gitlab_telegraf.influxdb_endpoints | join('","https://') }}"]
database = "telegraf"
timeout = "5s"
retention_policy = "{{ gitlab_telegraf.influxdb_retention_policy }}"
retention_policy_tag = "{{ gitlab_telegraf.influxdb_retention_policy_tag }}"
username = "{{ gitlab_telegraf.influxdb_username }}"
password = "{{ gitlab_telegraf.influxdb_password }}"
[[inputs.prometheus]]
urls = ["http://{{ gitlab_domain }}/-/metrics?token={{ gitlab_telegraf.metrics_token }}"]