Skip to content

Instantly share code, notes, and snippets.

View Jammink2's full-sized avatar

John Hammink Jammink2

View GitHub Profile
# tail -f /var/log/td-agent/td-agent.log
$ sudo docker run -ti --name test --log-driver=fluentd ubuntu /bin/bash
$ sudo service td-agent restart
<source>
@type forward
</source>
<source>
@type prometheus
</source>
<filter docker.**>
@type prometheus
<metric>
$ sudo nano /etc/td-agent/td-agent.conf
# A job to scrape an endpoint of Fluentd running on localhost.
scrape_configs:
- job_name: fluentd
scrape_interval: 5s
target_groups:
- targets:
- 'localhost:24231'
metrics_path: /metrics
./prometheus-0.16.1.linux-amd64/prometheus -config.file=/opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluent-plugin-prometheus-0.1.3/misc/prometheus.yaml -storage.local.path=./prometheus/metrics
$ wget https://github.com/prometheus/prometheus/releases/download/0.16.1/prometheus-0.16.1.linux-amd64.tar.gz -O - | tar zxf -
$ td-agent-gem install fluent-plugin-prometheus