description: An output plugin to expose Prometheus Metrics

Prometheus Exporter

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
listen This is address Fluent Bit will bind to when hosting prometheus metrics 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. [INPUT]
  14. name node_exporter_metrics
  15. tag node_metrics
  16. scrape_interval 2
  17. [OUTPUT]
  18. name prometheus_exporter
  19. match node_metrics
  20. listen 0.0.0.0
  21. port 2021
  22. # add user-defined labels
  23. add_label app fluent-bit
  24. add_label color blue