Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process Exporter Metrics: RSS memory is probably falsely given in page count instead of bytes #9343

Open
Bedledl opened this issue Sep 4, 2024 · 0 comments

Comments

@Bedledl
Copy link

Bedledl commented Sep 4, 2024

Bug Report

In https://github.com/fluent/fluent-bit/blob/master/plugins/in_process_exporter_metrics/pe_process.c#L1105 the RSS memory that is scraped from /proc//stat is set as "memory_bytes".

if (pe_utils_str_to_uint64(tmp, &val) != -1) {
       cmt_gauge_set(ctx->memory_bytes, ts, val, 4, (char *[]){ name, pid_str, ppid_str, "rss" });
}

In https://man7.org/linux/man-pages/man5/proc_pid_stat.5.html it is though specified that the rss value is given in number of pages.

To Reproduce
Get memory metrics by fluent-bit -i process_exporter_metrics -p metrics="memory" -o stdout, e.g.
process_memory_bytes{name="rsyslogd",pid="167",ppid="1",type="rss"} = 118

Look at actual RSS values with cat /proc/167/status | grep Rss:

RssAnon:             472 kB
RssFile:               0 kB
RssShmem:              0 kB

Actual behaviour
process_memory_bytes{type="rss"} gives page count but metric name is memory bytes.

Expected behavior
The metric value of process_memory_bytes{type="rss"} should be set multiplied by the system's page size, in this case ~472 000.

Your Environment

  • Version used: fluent-bit 3.1.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants