liveBook · Manning

Prometheus exporter plugin

As explained in Logs and Telemetry

prometheus_exporter is a Fluent Bit output plugin that exposes processed records in Prometheus metric exposition format over HTTP.

The `prometheus_exporter` output plugin exposes Fluent Bit records as Prometheus metrics over HTTP. Prometheus scrapes the Fluent Bit instance at the standard `/metrics` path, letting Fluent Bit act as the serving endpoint for metrics collected or prepared elsewhere in its pipeline. section 5.6.1 section 5.6

Use this output when Prometheus should control collection on a scheduled scrape interval. This differs from remote writing: `prometheus_remote_write` sends data through Prometheus’s push-oriented API, which suits environments where Fluent Bit instances may be replaced dynamically. section 5.6 section 5.12

The plugin serves records that are already formatted as Prometheus metric records. Its main configuration choices are:

  • `host` selects the network interfaces to listen on; `0.0.0.0` listens on all networks. section 5.6.1
  • `port` sets the HTTP port, allowing separate Prometheus outputs to listen on different ports. section 5.6.1
  • `add_label` attaches a name-value label pair to exported metrics; label names must follow Prometheus naming rules. section 5.6.1

Export node metrics on port 9885

Collect node data with `node_exporter_metrics`, then route it to `prometheus_exporter`: `[INPUT]` ` name node_exporter_metrics` ` tag node_metrics` ` scrape_interval 5` `[OUTPUT]` ` name prometheus_exporter` ` match *` ` host 0.0.0.0` ` port 9885` ` add_label fluentbit exporter` A scrape of `http://<host>:9885/metrics` returns Prometheus exposition lines such as `node_cpu_seconds_total`, with the added `fluentbit="exporter"` label.

This pattern can support separate consumers with different monitoring needs, such as infrastructure-wide server health and application-focused performance monitoring. It provides flexibility, though separate outputs should reflect a deliberate organizational design rather than become the default. section 5.6.1

How Logs and Telemetry covers it

How deep it goes
Explains routing, host, port, labels, and a node-metrics configuration, without detailing Prometheus server configuration.
Examples
Demonstrates node_exporter_metrics feeding CPU and disk metrics through an exporter on port 9885.
What it assumes
Assumes familiarity with Fluent Bit plugins and Prometheus metrics while avoiding a Kubernetes requirement through Docker Compose.
What you can do after
Operate/configure it to expose labeled node metrics at a Prometheus-compatible `/metrics` endpoint.
How it connects
Connects Prometheus scraping with prometheus_remote_write, node_exporter_metrics, fluentbit_metrics, Grafana, 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.