# CONFIGURED BY ANSIBLE # https://docs.fluentbit.io/manual/pipeline/inputs/fluentbit-metrics # # INDENTATION WITH SPACES NOT TABS [INPUT] name fluentbit_metrics tag internal_metrics scrape_interval 5 #[OUTPUT] # name file # match internal_metrics # path /var/log # file fluent-bit.log [OUTPUT] name prometheus_remote_write match internal_metrics host {{tsdb_host}} port {{tsdb_port}} # tsdb_http_user can be defined but empty # https://www.shellhacks.com/jinja2-check-if-variable-empty-exists-defined-true/ {% if tsdb_http_user|length %} tls on tls.verify on http_user {{tsdb_http_user}} http_passwd {{tsdb_http_passwd}} {% endif %} {% if metrics_type == 'standalone' %} uri /api/v1/write {% elif metrics_type == 'cluster' %} uri /insert/0/prometheus/api/v1/write {% endif %} log_response_payload true add_label sensor flb@{{inventory_hostname}} add_label instance {{inventory_hostname}} add_label host {{inventory_hostname}} # hard-coded in inventory file add_label site {{site}}