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

in_process_exporter_metrics: convert rss memory from pages to bytes #9350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Bedledl
Copy link

@Bedledl Bedledl commented Sep 4, 2024

#9343

Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

@Bedledl
Copy link
Author

Bedledl commented Sep 4, 2024

Example configuration: fluent-bit -i process_exporter_metrics -p metrics="memory" -o stdout

Output thats shows successful fix: process_memory_bytes{name="rsyslogd",pid="167",ppid="1",type="rss"} = 483328

cat /proc/167/status | grep Rss RssAnon: 472 kB RssFile: 0 kB RssShmem: 0 kB

Copy link
Contributor

@cosmo0920 cosmo0920 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, it works. I added a comment for the type of returning result of sysconf system call.

@@ -52,6 +52,7 @@ struct flb_pe {
struct flb_input_instance *ins; /* input instance */
struct mk_list *metrics; /* enabled metrics */
int enabled_flag; /* indicate enabled metrics */
int page_size; /* page size for converting number of pages to bytes */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sysconf(3) returns long type of value. So, do we need to use long instead of int here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants