Monitoring
Learn how to monitor your Fluent Bit data pipelines
Monitor data pipelines
Fluent Bit includes features for monitoring the internals of your pipeline, in addition to connecting to Prometheus and Grafana, Health checks, and connectors to use external services:
HTTP server
Fluent Bit includes an HTTP server for querying internal information and monitoring metrics of each running plugin.
You can integrate the monitoring interface with Prometheus.
Getting started
To get started, enable the HTTP server from the configuration file. The following configuration instructs Fluent Bit to start an HTTP server on TCP port 2020
and listen on all network interfaces:
Apply the configuration file:
Fluent Bit starts and generates output in your terminal:
Use curl
to gather information about the HTTP server. The following command sends the command output to the jq
program, which outputs human-readable JSON data to the terminal.
REST API interface
Fluent Bit exposes the following endpoints for monitoring.
URI | Description | Data format |
---|---|---|
/ | Fluent Bit build information. | JSON |
/api/v1/uptime | Return uptime information in seconds. | JSON |
/api/v1/metrics | Display internal metrics per loaded plugin. | JSON |
/api/v1/metrics/prometheus | Display internal metrics per loaded plugin in Prometheus Server format. | Prometheus Text 0.0.4 |
/api/v1/storage | Get internal metrics of the storage layer / buffered data. This option is enabled only if in the | JSON |
/api/v1/health | Display the Fluent Bit health check result. | String |
/api/v2/metrics | Display internal metrics per loaded plugin. | |
/api/v2/metrics/prometheus | Display internal metrics per loaded plugin ready in Prometheus Server format. | Prometheus Text 0.0.4 |
/api/v2/reload | Execute hot reloading or get the status of hot reloading. See the hot-reloading documentation. | JSON |
v1 metrics
The following descriptions apply to v1 metric endpoints.
/api/v1/metrics/prometheus
endpoint
The following descriptions apply to metrics outputted in Prometheus format by the /api/v1/metrics/prometheus
endpoint.
The following terms are key to understanding how Fluent Bit processes metrics:
Record: a single message collected from a source, such as a single long line in a file.
Chunk: log records ingested and stored by Fluent Bit input plugin instances. A batch of records in a chunk are tracked together as a single unit.
The Fluent Bit engine attempts to fit records into chunks of at most
2 MB
, but the size can vary at runtime. Chunks are then sent to an output. An output plugin instance can either successfully send the full chunk to the destination and mark it as successful, or it can fail the chunk entirely if an unrecoverable error is encountered, or it can ask for the chunk to be retried.
Metric name | Labels | Description | Type | Unit |
---|---|---|---|---|
| name: the name or alias for the input instance | The number of bytes of log records that this input instance has ingested successfully. | counter | bytes |
| name: the name or alias for the input instance | The number of log records this input ingested successfully. | counter | records |
| name: the name or alias for the output instance | The number of log records dropped by the output. These records hit an unrecoverable error or retries expired for their chunk. | counter | records |
| name: the name or alias for the output instance | The number of chunks with an error that's either unrecoverable or unable to retry. This metric represents the number of times a chunk failed, and doesn't correspond with the number of error messages visible in the Fluent Bit log output. | counter | chunks |
| name: the name or alias for the output instance | The number of bytes of log records that this output instance sent successfully. This metric represents the total byte size of all unique chunks sent by this output. If a record is not sent due to some error, it doesn't count towards this metric. | counter | bytes |
| name: the name or alias for the output instance | The number of log records that this output instance sent successfully. This metric represents the total record count of all unique chunks sent by this output. If a record is not sent successfully, it doesn't count towards this metric. | counter | records |
| name: the name or alias for the output instance | The number of log records that experienced a retry. This metric is calculated at the chunk level, the count increased when an entire chunk is marked for retry. An output plugin might perform multiple actions that generate many error messages when uploading a single chunk. | counter | records |
| name: the name or alias for the output instance | The number of times that retries expired for a chunk. Each plugin configures a | counter | chunks |
| name: the name or alias for the output instance | The number of times this output instance requested a retry for a chunk. | counter | chunks |
| The number of seconds that Fluent Bit has been running. | counter | seconds | |
| The Unix Epoch timestamp for when Fluent Bit started. | gauge | seconds |
/api/v1/storage
endpoint
The following descriptions apply to metrics outputted in JSON format by the /api/v1/storage
endpoint.
Metric Key | Description | Unit |
---|---|---|
| The total number of chunks of records that Fluent Bit is currently buffering. | chunks |
| The total number of chunks that are currently buffered in memory. Chunks can be both in memory and on the file system at the same time. | chunks |
| The total number of chunks saved to the filesystem. | chunks |
| The count of chunks that are both in file system and in memory. | chunks |
| The count of chunks that are only in the file system. | chunks |
| Indicates whether the input instance exceeded its configured | boolean |
| The size of memory that this input is consuming to buffer logs in chunks. | bytes |
| The buffer memory limit ( | bytes |
| The current total number of chunks owned by this input instance. | chunks |
| The current number of chunks that are in memory for this input. If file system storage is enabled, chunks that are "up" are also stored in the filesystem layer. | chunks |
| The current number of chunks that are "down" in the filesystem for this input. | chunks |
| Chunks are that are being processed or sent by outputs and are not eligible to have new data appended. | chunks |
| The sum of the byte size of each chunk which is currently marked as busy. | bytes |
v2 metrics
The following descriptions apply to v2 metric endpoints.
/api/v2/metrics/prometheus
or /api/v2/metrics
endpoint
The following descriptions apply to metrics outputted in Prometheus format by the /api/v2/metrics/prometheus
or /api/v2/metrics
endpoints.
The following terms are key to understanding how Fluent Bit processes metrics:
Record: a single message collected from a source, such as a single long line in a file.
Chunk: log records ingested and stored by Fluent Bit input plugin instances. A batch of records in a chunk are tracked together as a single unit.
The Fluent Bit engine attempts to fit records into chunks of at most
2 MB
, but the size can vary at runtime. Chunks are then sent to an output. An output plugin instance can either successfully send the full chunk to the destination and mark it as successful, or it can fail the chunk entirely if an unrecoverable error is encountered, or it can ask for the chunk to be retried.
Metric Name | Labels | Description | Type | Unit |
---|---|---|---|---|
| name: the name or alias for the input instance | The number of bytes of log records that this input instance has ingested successfully. | counter | bytes |
| name: the name or alias for the input instance | The number of log records this input ingested successfully. | counter | records |
| name: the name or alias for the filter instance | The number of bytes of log records that this filter instance has ingested successfully. | counter | bytes |
| name: the name or alias for the filter instance | The number of log records this filter has ingested successfully. | counter | records |
| name: the name or alias for the filter instance | The number of log records added by the filter into the data pipeline. | counter | records |
| name: the name or alias for the filter instance | The number of log records dropped by the filter and removed from the data pipeline. | counter | records |
| name: the name or alias for the output instance | The number of log records dropped by the output. These records hit an unrecoverable error or retries expired for their chunk. | counter | records |
| name: the name or alias for the output instance | The number of chunks with an error that's either unrecoverable or unable to retry. This metric represents the number of times a chunk failed, and doesn't correspond with the number of error messages visible in the Fluent Bit log output. | counter | chunks |
| name: the name or alias for the output instance | The number of bytes of log records that this output instance sent successfully. This metric represents the total byte size of all unique chunks sent by this output. If a record is not sent due to some error, it doesn't count towards this metric. | counter | bytes |
| name: the name or alias for the output instance | The number of log records that this output instance sent successfully. This metric represents the total record count of all unique chunks sent by this output. If a record is not sent successfully, it doesn't count towards this metric. | counter | records |
| name: the name or alias for the output instance | The number of log records that experienced a retry. This metric is calculated at the chunk level, the count increased when an entire chunk is marked for retry. An output plugin might perform multiple actions that generate many error messages when uploading a single chunk. | counter | records |
| name: the name or alias for the output instance | The number of times that retries expired for a chunk. Each plugin configures a | counter | chunks |
| name: the name or alias for the output instance | The number of times this output instance requested a retry for a chunk. | counter | chunks |
| hostname: the hostname on running Fluent Bit | The number of seconds that Fluent Bit has been running. | counter | seconds |
| hostname: the hostname on running Fluent Bit | The Unix Epoch time stamp for when Fluent Bit started. | gauge | seconds |
| hostname: the hostname, version: the version of Fluent Bit, os: OS type | Build version information. The returned value is originated from initializing the Unix Epoch time stamp of configuration context. | gauge | seconds |
| hostname: the hostname on running Fluent Bit | Collect the count of hot reloaded times. | gauge | seconds |
Storage layer
The following are detailed descriptions for the metrics collected by the storage layer.
Metric Name | Labels | Description | Type | Unit |
---|---|---|---|---|
| None | The total number of chunks of records that Fluent Bit is currently buffering. | gauge | chunks |
| None | The total number of chunks that are currently buffered in memory. Chunks can be both in memory and on the file system at the same time. | gauge | chunks |
| None | The total number of chunks saved to the file system. | gauge | chunks |
| None | The count of chunks that are both in file system and in memory. | gauge | chunks |
| None | The count of chunks that are only in the file system. | gauge | chunks |
| None | The total number of chunks are in a busy state. | gauge | chunks |
| None | The total bytes of chunks are in a busy state. | gauge | bytes |
| name: the name or alias for the input instance | Indicates whether the input instance exceeded its configured | gauge | boolean |
| name: the name or alias for the input instance | The size of memory that this input is consuming to buffer logs in chunks. | gauge | bytes |
| name: the name or alias for the input instance | The current total number of chunks owned by this input instance. | gauge | chunks |
| name: the name or alias for the input instance | The current number of chunks that are in memory for this input. If file system storage is enabled, chunks that are "up" are also stored in the filesystem layer. | gauge | chunks |
| name: the name or alias for the input instance | The current number of chunks that are "down" in the filesystem for this input. | gauge | chunks |
| name: the name or alias for the input instance | Chunks are that are being processed or sent by outputs and are not eligible to have new data appended. | gauge | chunks |
| name: the name or alias for the input instance | The sum of the byte size of each chunk which is currently marked as busy. | gauge | bytes |
| name: the name or alias for the output instance | The sum of the connection count of each output plugins. | gauge | bytes |
| name: the name or alias for the output instance | The sum of the connection count in a busy state of each output plugins. | gauge | bytes |
Uptime example
Query the service uptime with the following command:
The command prints a similar output like this:
Metrics example
Query internal metrics in JSON format with the following command:
The command prints a similar output like this:
Query metrics in Prometheus format
Query internal metrics in Prometheus Text 0.0.4 format:
This command returns the same metrics in Prometheus format instead of JSON:
Configure aliases
By default, configured plugins on runtime get an internal name in the format _plugin_name.ID_
. For monitoring purposes, this can be confusing if many plugins of the same type were configured. To make a distinction each configured input or output section can get an alias that will be used as the parent name for the metric.
The following example sets an alias to the INPUT
section of the configuration file, which is using the CPU input plugin:
When querying the related metrics, the aliases are returned instead of the plugin name:
Grafana dashboard and alerts
You can create Grafana dashboards and alerts using Fluent Bit's exposed Prometheus style metrics.
The provided example dashboard is heavily inspired by Banzai Cloud's logging operator dashboard with a few key differences, such as the use of the instance
label, stacked graphs, and a focus on Fluent Bit metrics. See this blog post for more information.
Alerts
Sample alerts are available here.
Health Check for Fluent Bit
Fluent bit now supports four new configs to set up the health check.
Configuration name | Description | Default |
---|---|---|
| enable Health check feature | Off |
| the error count to meet the unhealthy requirement, this is a sum for all output plugins in a defined HC_Period, example for output error: | 5 |
| the retry failure count to meet the unhealthy requirement, this is a sum for all output plugins in a defined HC_Period, example for retry failure: | 5 |
| The time period by second to count the error and retry failure data point | 60 |
Not every error log means an error to be counted. The error retry failures count only on specific errors, which is the example in configuration table description.
Based on the HC_Period
setting, if the real error number is over HC_Errors_Count
, or retry failure is over HC_Retry_Failure_Count
, Fluent Bit is considered unhealthy. The health endpoint returns an HTTP status 500
and an error
message. Otherwise, the endpoint returns HTTP status 200
and an ok
message.
The equation to calculate this behavior is:
The HC_Errors_Count
and HC_Retry_Failure_Count
only count for output plugins and count a sum for errors and retry failures from all running output plugins.
The following configuration file example shows how to define these settings:
Use the following command to call the health endpoint:
With the example config, the health status is determined by the following equation:
If this equation evaluates to
TRUE
, then Fluent Bit is unhealthy.If this equation evaluates to
FALSE
, then Fluent Bit is healthy.
Telemetry Pipeline
Telemetry Pipeline is a hosted service that allows you to monitor your Fluent Bit agents including data flow, metrics, and configurations.
Last updated