For the complete documentation index, see llms.txt. This page is also available as Markdown.

Prometheus scrape Metrics

Fluent Bit 1.9 and later includes additional metrics features to let you collect logs and metrics from a Prometheus-based endpoint at a set interval. These metrics can be routed to metric supported endpoints such as Prometheus Exporter, InfluxDB or Prometheus Remote Write.

Configuration

Key
Description
Default

host

The host of the Prometheus metric endpoint to scrape.

none

port

The port of the Prometheus metric endpoint to scrape.

none

scrape_interval

The interval to scrape metrics.

10s

metrics_path

The metrics URI endpoint, which must start with a forward slash (/). Parameters can be added to the path by using ?

/metrics

threaded

Indicates whether to run this input in its own thread.

false

Example

If an endpoint exposes Prometheus Metrics you can specify the configuration to scrape and then output the metrics. The following example retrieves metrics from the HashiCorp Vault application.

pipeline:
  inputs:
    - name: prometheus_scrape
      host: 0.0.0.0
      port: 8201
      tag: vault
      metrics_path: /v1/sys/metrics?format=prometheus
      scrape_interval: 10s

  outputs:
    - name: stdout
      match: '*'
[INPUT]
  name prometheus_scrape
  host 0.0.0.0
  port 8201
  tag vault
  metrics_path /v1/sys/metrics?format=prometheus
  scrape_interval 10s

[OUTPUT]
  name stdout
  match *

This returns output similar to:

Last updated

Was this helpful?