fluent / fluent/fluent-bit

Fluent-bit metrics timestamps not updated

Open
#8,416 3 comments 5 reactions 0 assignees View on GitHub
exempt-stale status: waiting-for-triage
Dominant language
C
Stars
8.1k
Forks
2k
Avg merge
4d 20h
Merged PRs (30d)
71

Description

## Bug Report

**Describe the bug**
Fluent-bit own metric timestamps are updated only if the metric is updated. This makes some metric datapoint too old to consume into metric storage services.

**To Reproduce**
Fluent-bit metrics input enabled. File or any other output for the fluent-bit metrics.
Example uses file and opentelemetry outputs.
- Example output from file:
```
2024-01-24T09:41:10.441988883Z fluentbit_output_proc_records_total{name="example-otel-output"} = 0
2024-01-24T09:41:10.441988883Z fluentbit_output_proc_bytes_total{name="example-otel-output"} = 6147328
2024-01-24T09:31:06.794159432Z fluentbit_output_errors_total{name="example-otel-output"} = 0
2024-01-24T09:31:06.794159432Z fluentbit_output_retries_total{name="example-otel-output"} = 0
2024-01-24T09:31:06.794159432Z fluentbit_output_retries_failed_total{name="example-otel-output"} = 0
2024-01-24T09:31:06.794159432Z fluentbit_output_dropped_records_total{name="example-otel-output"} = 0
2024-01-24T09:31:06.794159432Z fluentbit_output_retried_records_total{name="example-otel-output"} = 0
2024-01-24T09:41:21.188470385Z fluentbit_output_upstream_total_connections{name="example-otel-output"} = 0
2024-01-24T09:41:10.441924567Z fluentbit_output_upstream_busy_connections{name="example-otel-output"} = 0
```
- Steps to reproduce the problem:

**Expected behavior**
All metric timestamps are renewed when metric scrape by fluent-bit metrics input is done.

```
2024-01-24T09:41:21.188470385Z fluentbit_output_proc_records_total{name="example-otel-output"} = 0
2024-01-24T09:41:21.188470385Z fluentbit_output_proc_bytes_total{name="example-otel-output"} = 6147328
2024-01-24T09:41:21.188470385Z fluentbit_output_errors_total{name="example-otel-output"} = 0
2024-01-24T09:41:21.188470385Z fluentbit_output_retries_total{name="example-otel-output"} = 0
2024-01-24T09:41:21.188470385Z fluentbit_output_retries_failed_total{name="example-otel-output"} = 0
2024-01-24T09:41:21.188470385Z fluentbit_output_dropped_records_total{name="example-otel-output"} = 0
2024-01-24T09:41:21.188470385Z fluentbit_output_retried_records_total{name="example-otel-output"} = 0
2024-01-24T09:41:21.188470385Z fluentbit_output_upstream_total_connections{name="example-otel-output"} = 0
2024-01-24T09:41:21.188470385Z fluentbit_output_upstream_busy_connections{name="example-otel-output"} = 0
```

**Your Environment**

* Version used: 2.2.2 and older ones
* Configuration:
* Environment name and version (e.g. Kubernetes? What version?): Linux and Windows

This was also very well described in issue #7650

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.