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

Telegraf 1.26.2. Memory Input Plugin - inputs.mem. mem.write_back - zero value. #13299

Closed
syatihoko opened this issue May 22, 2023 · 9 comments · Fixed by #13396
Closed

Telegraf 1.26.2. Memory Input Plugin - inputs.mem. mem.write_back - zero value. #13299

syatihoko opened this issue May 22, 2023 · 9 comments · Fixed by #13396
Labels
bug unexpected problem or unintended behavior upstream bug or issues that rely on dependency fixes

Comments

@syatihoko
Copy link

syatihoko commented May 22, 2023

Relevant telegraf.conf

[global_tags]


[agent]
  interval = "30s"
  round_interval = false

  metric_batch_size = 10000

  metric_buffer_limit = 100000

  collection_jitter = "0s"

  flush_interval = "10s"
  flush_jitter = "0s"

  precision = ""

  debug = true


  logfile = "/var/log/telegraf/telegraf.log"



  hostname = "name_host"
  omit_hostname = false


 [[outputs.graphite]]
   servers = ["MY_HIDDEN_HOST:2003"]
   prefix = "servers"
   template = "host.measurement.tags.field"
   timeout = 17

Logs from Telegraf

2023-05-22T07:52:46Z I! [agent] Hang on, flushing any cached metrics before shutdown
2023-05-22T07:52:46Z I! [agent] Stopping running outputs
2023-05-22T07:52:46Z I! Starting Telegraf 1.26.2
2023-05-22T07:52:46Z I! Available plugins: 235 inputs, 9 aggregators, 27 processors, 22 parsers, 57 outputs, 2 secret-stores
@@@

System info

Telegraf 1.26.2. Ubuntu 18.04, 22.04

Docker

No response

Steps to reproduce

  1. telegraf --test -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d/common.conf --input-filter=mem

Expected behavior

write_back= and write_back_tmp more 0

Actual behavior

write_back=0i,write_back_tmp=0i

Additional info

After update to Telegraf 1.26.2, the metric "mem.write_back" began to accept only a zero value on all servers.
OS - Ubuntu 18.04, 22.04

telegraf --test -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d/ --input-filter=mem:
active=24328122368i,available=25401221120i,available_percent=75.5993608248227,buffered=135442432i,cached=25453924352i,commit_limit=18947371008i,committed_as=8156454912i,dirty=37199872i,free=299200512i,high_free=0i,high_total=0i,huge_page_size=2097152i,huge_pages_free=0i,huge_pages_total=0i,inactive=7386312704i,low_free=0i,low_total=0i,mapped=164855808i,page_tables=23384064i,shared=917504i,slab=1301299200i,sreclaimable=1240989696i,sunreclaim=60309504i,swap_cached=278528i,swap_free=2143285248i,swap_total=2147479552i,total=33599782912i,used=7711215616i,used_percent=22.95019475630593,vmalloc_chunk=0i,vmalloc_total=35184372087808i,vmalloc_used=0i,write_back=0i,write_back_tmp=0i 1684741645000000000

@syatihoko syatihoko added the bug unexpected problem or unintended behavior label May 22, 2023
@syatihoko
Copy link
Author

syatihoko commented May 22, 2023

Unfortunately, there is no whole story - the version where it continues to work:

Telegraf 1.20.4
Telegraf 1.20.0
Telegraf 1.19.1
Telegraf 1.15.2

@syatihoko
Copy link
Author

syatihoko commented May 22, 2023

Run command grep -e Dirty: -e Writeback: /proc/meminfo on Host where problem:

11:38
Dirty:             35584 kB
Writeback:       3450572 kB
11:44
Dirty:             31928 kB
Writeback:       3450608 kB
11:46 
Dirty:             81264 kB
Writeback:       3450616 kB

@powersj
Copy link
Contributor

powersj commented May 22, 2023

Hi,

The memory plugin data comes from gopsutil. It would help greatly if you could narrow down to what version of telegraf was the last working and the first broken. From there we can determine which version of gopsutil no longer reports the value correctly.

My guess is that it is because upstream is looking for WriteBack and not Writeback, note the lower-case b.

Would you be willing to file an upstream issue?

@powersj powersj added the waiting for response waiting for response from contributor label May 22, 2023
@syatihoko
Copy link
Author

Hello.

Would you be willing to file an upstream issue?
Sure.

I'll try to calculate the specific version that had the problem

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label May 23, 2023
@powersj
Copy link
Contributor

powersj commented May 23, 2023

Thanks - please do let us know what version you track it down to and if you file an upstream issue.

@powersj powersj added the waiting for response waiting for response from contributor label May 23, 2023
@syatihoko
Copy link
Author

Hi, finished the tests:
telegraf_1.20.4-1_amd64.deb. - work
..
telegraf_1.21.0~rc1-1_amd64.deb. - doesn't work

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label May 24, 2023
@powersj
Copy link
Contributor

powersj commented May 24, 2023

Looking at our diff, it looks like there were two changes to our gopsutil usage between v1.20.4 and 1.21.0-rc1:

I went through the diff for v3.21.8 and v3.21.10 and was able to compare the v3 and previous version:

I have filed an upstream issue shirou/gopsutil#1471 and put up shirou/gopsutil#1472 to fix the capitalization.

@powersj powersj added the upstream bug or issues that rely on dependency fixes label May 24, 2023
@powersj
Copy link
Contributor

powersj commented May 25, 2023

My upstream PR was just merged! I think the maintainer should do a release soon, then we can get that in telegraf with the fix.

@powersj
Copy link
Contributor

powersj commented Jun 6, 2023

Hi,

A release was made last week, and I have put up #13396 to update to the new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior upstream bug or issues that rely on dependency fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants