Skip to content

Conversation

edsiper
Copy link
Member

@edsiper edsiper commented Jul 23, 2025

This PR introduces a new input plugin for Fluent Bit that scrapes metrics from text files written in the Prometheus exposition format. It mimics the behavior of Prometheus’ textfile collector, enabling users to ingest custom metrics from .prom files and forward them through the Fluent Bit pipeline.

  • Supports reading .prom files with Prometheus-style metric definitions.
  • Periodically scans specified file paths or glob patterns.
  • Parses and converts metrics into Fluent Bit-compatible data.
  • Compatible with Prometheus tooling and custom exporters that emit text-based metrics.
  • Useful for exposing one-off or custom metrics from scripts and external processes.
service:
  flush: 1
  log_level: info

pipeline:
  inputs:
    - name: prometheus_textfile
      path: /var/lib/metrics/*.prom
      scrape_interval: 5s

  outputs:
    - name: stdout
      match: "*"

note: path supports glob patterns like *.prom.

Fixes: #10595 #10486


Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

edsiper added 3 commits July 23, 2025 17:19
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@cosmo0920
Copy link
Contributor

BTW, the test data for reading runtime tests for prometheus_textfile is missing in this PR?

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@edsiper
Copy link
Member Author

edsiper commented Jul 24, 2025

@cosmo0920 yeah good catch, I forgot to add the test data file :D , just added it

@edsiper
Copy link
Member Author

edsiper commented Jul 24, 2025

s390x :/

@edsiper edsiper merged commit 813e5b9 into master Jul 24, 2025
75 of 78 checks passed
@edsiper edsiper deleted the prometheus_textfile branch July 24, 2025 17:43
@cosmo0920
Copy link
Contributor

s390x :/

No worries, 19 - flb-it-input_chunk (Failed) is some times flaky on s390x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add textfile collector for node_exporter_metrics and windows_exporter_metrics
2 participants