liveBook · Manning

Fluentbit_metrics input plugin

As explained in Logs and Telemetry

The fluentbit_metrics input plugin is a Fluent Bit input plugin that exposes Fluent Bit metrics for collection by Prometheus.

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

How Logs and Telemetry covers it

How deep it goes
Defines interval, tag, startup scraping, routing, and querying, but illustrates metric content through only one example counter.
Examples
Uses a five-second scrape configuration, port 9885 exporter endpoint, and fluentbit_input_metrics_scrapes_total query.
What it assumes
Assumes a running Fluent Bit configuration and a Prometheus instance able to scrape its exporter endpoint.
What you can do after
Operate Fluent Bit as a Prometheus-scraped source of its own deployment metrics.
How it connects
Connects Fluent Bit metrics with Prometheus, prometheus_exporter, node_exporter_metrics, prometheus_remote_write, and PromQL.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Logs and Telemetry. The section links point to the parts of the book it draws on.