Prometheus Scrape Metrics

Fluent Bit 1.9 includes additional metrics features to allow you to collect both logs and metrics with the same collector.

The initial release of the Prometheus Scrape metric allows you to collect 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 that you want to scrape

port

The port of the prometheus metric endpoint that you want to scrape

scrape_interval

The interval to scrape metrics

10s

metrics_path

The metrics URI endpoint, that must start with a forward slash. Note: Parameters can also be added to the path by using ?

/metrics

Example

If an endpoint exposes Prometheus Metrics we can specify the configuration to scrape and then output the metrics. In the following example, we retrieve metrics from the HashiCorp Vault application.

[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 *

Example Output

Last updated

Was this helpful?