Prometheus Exporter
An output plugin to expose Prometheus Metrics
The prometheus exporter allows you to take metrics from Fluent Bit and expose them such that a Prometheus instance can scrape them.
Important Note: The prometheus exporter only works with metric plugins, such as Node Exporter Metrics
Key
Description
Default
host
This is address Fluent Bit will bind to when hosting prometheus metrics. Note: listen parameter is deprecated from v1.9.0.
0.0.0.0
port
This is the port Fluent Bit will bind to when hosting prometheus metrics
2021
add_label
This allows you to add custom labels to all metrics exposed through the prometheus exporter. You may have multiple of these fields

Getting Started

The Prometheus exporter only works with metrics captured from metric plugins. In the following example, host metrics are captured by the node exporter metrics plugin and then are routed to prometheus exporter. Within the output plugin two labels are added app="fluent-bit"and color="blue"
1
# Node Exporter Metrics + Prometheus Exporter
2
# -------------------------------------------
3
# The following example collect host metrics on Linux and expose
4
# them through a Prometheus HTTP end-point.
5
#
6
# After starting the service try it with:
7
#
8
# $ curl http://127.0.0.1:2021/metrics
9
#
10
[SERVICE]
11
flush 1
12
log_level info
13
14
[INPUT]
15
name node_exporter_metrics
16
tag node_metrics
17
scrape_interval 2
18
19
[OUTPUT]
20
name prometheus_exporter
21
match node_metrics
22
host 0.0.0.0
23
port 2021
24
# add user-defined labels
25
add_label app fluent-bit
26
add_label color blue
Copied!
Last modified 1mo ago
Export as PDF
Copy link