Documentation

Bcache Input Plugin

This plugin gathers statistics for the block layer cache from the stats_total directory and dirty_data file.

Introduced in: Telegraf v0.2.0 Tags: system OS support: linux

Global configuration options

In addition to the plugin-specific configuration settings, plugins support additional global and plugin configuration settings. These settings are used to modify metrics, tags, and field or create aliases and configure ordering, etc. See the CONFIGURATION.md for more details.

Configuration

# Read metrics of bcache from stats_total and dirty_data
# This plugin ONLY supports Linux
[[inputs.bcache]]
  ## Bcache sets path
  ## If not specified, then default is:
  bcachePath = "/sys/fs/bcache"

  ## By default, Telegraf gather stats for all bcache devices
  ## Setting devices will restrict the stats to the specified
  ## bcache devices.
  bcacheDevs = ["bcache0"]

Metrics

Tags:

  • backing_dev device backed by the cache
  • bcache_dev device used for caching

Fields:

  • dirty_data: Amount of dirty data for this backing device in the cache. Continuously updated unlike the cache set’s version, but may be slightly off
  • bypassed: Amount of IO (both reads and writes) that has bypassed the cache
  • cache_bypass_hits: Hits for IO that is intended to skip the cache
  • cache_bypass_misses: Misses for IO that is intended to skip the cache
  • cache_hits: Hits per individual IO as seen by bcache sees them; a partial hit is counted as a miss.
  • cache_misses: Misses per individual IO as seen by bcache sees them; a partial hit is counted as a miss.
  • cache_hit_ratio: Hit to miss ratio
  • cache_miss_collisions: Instances where data was going to be inserted into cache from a miss, but raced with a write and data was already present (usually zero since the synchronization for cache misses was rewritten)
  • cache_readaheads: Count of times readahead occurred.

Example Output

bcache,backing_dev="md10",bcache_dev="bcache0" dirty_data=11639194i,bypassed=5167704440832i,cache_bypass_hits=146270986i,cache_bypass_misses=0i,cache_hit_ratio=90i,cache_hits=511941651i,cache_miss_collisions=157678i,cache_misses=50647396i,cache_readaheads=0i

Was this page helpful?

Thank you for your feedback!


New in InfluxDB 3.5

Key enhancements in InfluxDB 3.5 and the InfluxDB 3 Explorer 1.3.

See the Blog Post

InfluxDB 3.5 is now available for both Core and Enterprise, introducing custom plugin repository support, enhanced operational visibility with queryable CLI parameters and manual node management, stronger security controls, and general performance improvements.

InfluxDB 3 Explorer 1.3 brings powerful new capabilities including Dashboards (beta) for saving and organizing your favorite queries, and cache querying for instant access to Last Value and Distinct Value caches—making Explorer a more comprehensive workspace for time series monitoring and analysis.

For more information, check out:

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On November 3, 2025, the latest tag for InfluxDB Docker images will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments.

If using Docker to install and run InfluxDB, the latest tag will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments. For example, if using Docker to run InfluxDB v2, replace the latest version tag with a specific version tag in your Docker pull command–for example:

docker pull influxdb:2