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
bearer_token
Set the bearer token for authentication with the Prometheus endpoint.
none
buffer_max_size
Set the maximum buffer size for the HTTP response.
10M
host
The host of the Prometheus metric endpoint to scrape.
localhost
http_passwd
Set the password for HTTP basic authentication.
""
http_user
Set the username for HTTP basic authentication.
none
metrics_path
The metrics URI endpoint, which must start with a forward slash (/). Parameters can be added to the path by using ?
/metrics
port
The port of the Prometheus metric endpoint to scrape.
9100
scrape_interval
The interval to scrape metrics.
10s
threaded
Indicates whether to run this input in its own thread.
false
TLS configuration
This plugin supports TLS/SSL for secure connections to HTTPS endpoints. For detailed TLS configuration options, refer to the TLS/SSL documentation section.
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.
[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 *