The fluentbit_metrics input plugin exposes metrics about Fluent Bit itself as Prometheus-style data. Prometheus can scrape these metrics on a schedule, allowing Fluent Bit to serve as both an observability agent and the system being monitored. section 5.6 section 5.6.3
Configure the plugin around a small set of operational choices:
- Set scrape_interval in seconds to control how often Fluent Bit generates its metrics. section 5.6.3
- Set tag to identify the generated metric events. section 5.6.3
- Enable scrape_on_start when metrics should be generated immediately; the option defaults to false when omitted. section 5.6.3
- Send the generated events through prometheus_exporter; unlike node_exporter_metrics, this input is not platform sensitive and does not require output-plugin changes. section 5.6 section 5.6.3
Expose Fluent Bit metrics for Prometheus
A practical configuration uses a five-second scrape interval, generates metrics on startup, and exposes all matching events on port 9885 through prometheus_exporter. Start it with `fluent-bit -c fluentbit/prometheus-fb-exporter-output.conf`, then query Prometheus for `fluentbit_input_metrics_scrapes_total` at its graph interface. section 5.6.3
Listing 5.7 Fluent Bit metrics: prometheus-fb-exporter-output.conf
[SERVICE]
flush 5
log_level info
[INPUT]
name fluentbit_metrics
tag fluentbit_metrics
scrape_interval 5 #1
scrape_on_start true #2
[OUTPUT]
name prometheus_exporter
match *
port 9885
host 0.0.0.0
add_label fluentbit exporter
Use the complete configuration listing to inspect the required input settings, exporter endpoint, and label configuration. section 5.6.3
