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

[inputs.procstat] systemd_unit is no longer working after #13417 #14438

Closed
tjnome opened this issue Dec 12, 2023 · 5 comments · Fixed by #14440
Closed

[inputs.procstat] systemd_unit is no longer working after #13417 #14438

tjnome opened this issue Dec 12, 2023 · 5 comments · Fixed by #14440
Assignees
Labels
bug unexpected problem or unintended behavior regression something that used to work, but is now broken

Comments

@tjnome
Copy link

tjnome commented Dec 12, 2023

Relevant telegraf.conf

[[inputs.procstat]]
  systemd_unit = "crond.service"

Logs from Telegraf

telegraf --test --debug --config /tmp/test.conf 

2023-12-12T10:25:55Z I! Loading config: /tmp/test.conf
2023-12-12T10:25:55Z E! error loading config file /tmp/test.conf: plugin inputs.procstat: line 1: configuration specified the fields ["systemd_unit"], but they weren't used

System info

Telegraf 1.29.0

Docker

No response

Steps to reproduce

  1. Use old config from before 1.29.0 update or follow README doc https://github.com/influxdata/telegraf/blob/master/plugins/inputs/procstat/README.md

...

Expected behavior

The intended behavior should be metrics. However, due to modifications in the TOML configuration, it no longer searches for 'systemd_unit' but rather 'systemd_units' and old configuration fails

Actual behavior

2023-12-12T10:25:55Z E! error loading config file /tmp/test.conf: plugin inputs.procstat: line 1: configuration specified the fields ["systemd_unit"], but they weren't used

Additional info

This is a straightforward bug that testing should have identified. To ensure 'input.procstat' functions correctly in version 1.29.0, the configuration must be altered from 'systemd_unit' to 'systemd_units'. This change appears to be unexpected and likely an oversight.

@tjnome tjnome added the bug unexpected problem or unintended behavior label Dec 12, 2023
@poulhs
Copy link

poulhs commented Dec 12, 2023

Influx data support case Number: 00115464

@srebhan srebhan added the regression something that used to work, but is now broken label Dec 12, 2023
@srebhan
Copy link
Member

srebhan commented Dec 12, 2023

@tjnome, @poulhs and @hackery first of all sorry for breaking your configs! Can you please check the binary in PR #14440 available once CI finished the tests!? Let me know if this fixes the issue!

@srebhan srebhan self-assigned this Dec 12, 2023
@tjnome
Copy link
Author

tjnome commented Dec 12, 2023

No problem. I have tested the RP on RHEL[7-9] and works flawlessly. @srebhan

@poulhs
Copy link

poulhs commented Dec 12, 2023

works fine for me too:

  • /usr/bin/telegraf --version
    Telegraf 1.30.0-bfe2033b (git: pull/14440@bfe2033b)
  • /usr/bin/telegraf --test --config inputs_procstat_crond.conf
    2023-12-12T13:29:32Z I! Loading config: inputs_procstat_crond.conf
    2023-12-12T13:29:32Z I! Starting Telegraf 1.30.0-bfe2033b brought to you by InfluxData the makers of InfluxDB
    2023-12-12T13:29:32Z I! Available plugins: 241 inputs, 9 aggregators, 30 processors, 24 parsers, 60 outputs, 6 secret-stores
    2023-12-12T13:29:32Z I! Loaded inputs: procstat
    2023-12-12T13:29:32Z I! Loaded aggregators:
    2023-12-12T13:29:32Z I! Loaded processors:
    2023-12-12T13:29:32Z I! Loaded secretstores:
    2023-12-12T13:29:32Z W! Outputs are not used in testing mode!
    2023-12-12T13:29:32Z I! Tags enabled: host=hostname.elided

procstat,host=hostname.elided,process_name=crond,systemd_unit=crond.service child_major_faults=80i,child_minor_faults=10829757i,cmdline="/usr/sbin/crond -n",cpu_time=2i,cpu_time_iowait=0,cpu_time_system=2.05,cpu_time_user=0.38,cpu_usage=0,created_at=1701660895000000000i,involuntary_context_switches=269i,major_faults=2i,memory_anonymous=868i,memory_data=847872i,memory_locked=0i,memory_private_clean=64i,memory_private_dirty=868i,memory_pss=1032i,memory_referenced=3660i,memory_rss=3747840i,memory_shared_clean=2728i,memory_shared_dirty=0i,memory_size=0i,memory_stack=532480i,memory_swap=0i,memory_usage=0.09865377843379974,memory_vms=8749056i,minor_faults=10082i,nice_priority=20i,num_fds=6i,num_threads=1i,pid=1683i,ppid=1i,read_bytes=49033216i,read_count=16448201i,realtime_priority=0i,rlimit_cpu_time_hard=9223372036854775807i,rlimit_cpu_time_soft=9223372036854775807i,rlimit_file_locks_hard=9223372036854775807i,rlimit_file_locks_soft=9223372036854775807i,rlimit_memory_data_hard=9223372036854775807i,rlimit_memory_data_soft=9223372036854775807i,rlimit_memory_locked_hard=8388608i,rlimit_memory_locked_soft=8388608i,rlimit_memory_rss_hard=9223372036854775807i,rlimit_memory_rss_soft=9223372036854775807i,rlimit_memory_stack_hard=9223372036854775807i,rlimit_memory_stack_soft=8388608i,rlimit_memory_vms_hard=9223372036854775807i,rlimit_memory_vms_soft=9223372036854775807i,rlimit_nice_priority_hard=0i,rlimit_nice_priority_soft=0i,rlimit_num_fds_hard=524288i,rlimit_num_fds_soft=1024i,rlimit_realtime_priority_hard=0i,rlimit_realtime_priority_soft=0i,rlimit_signals_pending_hard=14333i,rlimit_signals_pending_soft=14333i,signals_pending=0i,status="sleep",user="root",voluntary_context_switches=12527i,write_bytes=12580835328i,write_count=4152596i 1702387773000000000
procstat_lookup,host=hostname.elided,pid_finder=pgrep,result=success pid_count=1i,result_code=0i,running=1i 1702387773000000000

  • : status=0

@hackery
Copy link
Contributor

hackery commented Dec 12, 2023

Thanks @srebhan - we won't be taking the PR binary for production use, but it looks like it'll land in 1.29.1, we'll take that when it releases.

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 regression something that used to work, but is now broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants