fluent-bit icon indicating copy to clipboard operation
fluent-bit copied to clipboard

Discrepancy Between Default storage_metrics Setting in Code and Documentation

Open GarupanOjisan opened this issue 1 year ago • 1 comments

Bug Report

Describe the bug

There is a discrepancy between the default value of the storage_metrics setting in the code (flb_config.c#L280) and the official documentation. In the code, storage_metrics is set to FLB_TRUE by default, while the documentation states that the default value is Off.

To Reproduce

  • Steps to reproduce the problem:
  1. Use the following config.

fluent-bit.yaml

service:
  http_server: on
  1. Run fluent-bit 3.0.7
docker run --rm -it -p 2020:2020 -v $(pwd)/fluent-bit.yaml:/fluent-bit/etc/fluent-bit.yaml fluent/fluent-bit:3.0.7 -c /fluent-bit/etc/fluent-bit.yaml
  1. Fetch the metrics with curl, then the storage metrics are returned while storage.metrics is not set (the default value is Off ).
curl http://localhost:2020/api/v2/metrics/prometheus
# HELP fluentbit_uptime Number of seconds that Fluent Bit has been running.
# TYPE fluentbit_uptime counter
fluentbit_uptime{hostname="52da66687fce"} 14
# HELP fluentbit_process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE fluentbit_process_start_time_seconds gauge
fluentbit_process_start_time_seconds{hostname="52da66687fce"} 1719471663
# HELP fluentbit_build_info Build version information.
# TYPE fluentbit_build_info gauge
fluentbit_build_info{hostname="52da66687fce",version="3.0.7",os="linux"} 1719471663
# HELP fluentbit_hot_reloaded_times Collect the count of hot reloaded times.
# TYPE fluentbit_hot_reloaded_times gauge
fluentbit_hot_reloaded_times{hostname="52da66687fce"} 0
# HELP fluentbit_storage_chunks Total number of chunks in the storage layer.
# TYPE fluentbit_storage_chunks gauge
fluentbit_storage_chunks 0
# HELP fluentbit_storage_mem_chunks Total number of memory chunks.
# TYPE fluentbit_storage_mem_chunks gauge
fluentbit_storage_mem_chunks 0
# HELP fluentbit_storage_fs_chunks Total number of filesystem chunks.
# TYPE fluentbit_storage_fs_chunks gauge
fluentbit_storage_fs_chunks 0
# HELP fluentbit_storage_fs_chunks_up Total number of filesystem chunks up in memory.
# TYPE fluentbit_storage_fs_chunks_up gauge
fluentbit_storage_fs_chunks_up 0
# HELP fluentbit_storage_fs_chunks_down Total number of filesystem chunks down.
# TYPE fluentbit_storage_fs_chunks_down gauge
fluentbit_storage_fs_chunks_down 0

On the other hand, if I explicitly set storage.metrics to Off, the storage metrics will no longer exported.

service:
  http_server: on
  storage.metrics: Off

Expected behavior

If no value is set for storage.metrics, it is expected that the storage metrics will not be exported, as stated in the documentation.

curl http://localhost:2020/api/v2/metrics/prometheus
# HELP fluentbit_uptime Number of seconds that Fluent Bit has been running.
# TYPE fluentbit_uptime counter
fluentbit_uptime{hostname="5f9da872910b"} 5
# HELP fluentbit_process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE fluentbit_process_start_time_seconds gauge
fluentbit_process_start_time_seconds{hostname="5f9da872910b"} 1719472051
# HELP fluentbit_build_info Build version information.
# TYPE fluentbit_build_info gauge
fluentbit_build_info{hostname="5f9da872910b",version="3.0.7",os="linux"} 1719472051
# HELP fluentbit_hot_reloaded_times Collect the count of hot reloaded times.
# TYPE fluentbit_hot_reloaded_times gauge
fluentbit_hot_reloaded_times{hostname="5f9da872910b"} 0

Screenshots

Your Environment

  • Version used: 3.0.7
  • Configuration:
service:
  http_server: on
  • Environment name and version (e.g. Kubernetes? What version?): Kubernetes 1.26.0, Podman Desktop
  • Operating System and version: Rocky Linux 8.7 and Macos 14.5
  • Filters and plugins: none (This problem can be reproduced without any filters and plugins)

Additional context

GarupanOjisan avatar Jun 27 '24 07:06 GarupanOjisan

Please send a docs PR

patrick-stephens avatar Jun 27 '24 13:06 patrick-stephens

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

github-actions[bot] avatar Sep 27 '24 02:09 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Oct 03 '24 02:10 github-actions[bot]