LinkedNestBlog

Fluentd For Prometheus

by Dev Jinwon

Ref.]

Plugin Installation

[happytuk@ht-qa ~]$ sudo td-agent-gem install fluent-plugin-prometheus
[sudo] password for happytuk:
Fetching: prometheus-client-2.1.0.gem (100%)
Successfully installed prometheus-client-2.1.0
Fetching: fluent-plugin-prometheus-2.0.2.gem (100%)
Successfully installed fluent-plugin-prometheus-2.0.2
Parsing documentation for prometheus-client-2.1.0
Installing ri documentation for prometheus-client-2.1.0
Parsing documentation for fluent-plugin-prometheus-2.0.2
Installing ri documentation for fluent-plugin-prometheus-2.0.2
Done installing documentation for prometheus-client, fluent-plugin-prometheus after 1 seconds
2 gems installed

Add Fluentd's config file

[happytuk@ht-qa td-agent]$ sudo vi /etc/td-agent/td-agent.conf

Add Content

...
<source>
 @type prometheus
 bind 0.0.0.0
 port 24231
 metrics_path /metrics
</source>

<source>
 @type prometheus_output_monitor
 interval 10
 <labels>
   hostname 10.100.4.8
 </labels>
</source>
...

Reload(Restart) Fluentd

[happytuk@ht-qa td-agent]$ sudo /etc/init.d/td-agent reload
Reloading td-agent: td-agent                               [  OK  ]

Access

http://{IP}:24231/metrics

 


Fluentd For Prometheus · LinkedNest Blog