Skip to content

Instantly share code, notes, and snippets.

@mjf
Created June 23, 2022 07:04
Show Gist options
  • Save mjf/0e20b2d82700c967fb830eb220fb7149 to your computer and use it in GitHub Desktop.
Save mjf/0e20b2d82700c967fb830eb220fb7149 to your computer and use it in GitHub Desktop.
Telegraf configuration to collect Pressure Stall Information (PSI)
# Telegraf configuration to collect Pressure Stall Information (PSI)
[[inputs.file]]
name_override = "pressure_cpu"
# interval = "5s"
files = ["/proc/pressure/cpu"]
data_format = "grok"
grok_patterns = [
"%{NOTSPACE:type:tag} avg10=%{NUMBER:avg10:float} avg60=%{NUMBER:avg60:float} avg300=%{NUMBER:avg300:float} total=%{NUMBER:total:int}"
]
[[inputs.file]]
name_override = "pressure_io"
# interval = "5s"
files = ["/proc/pressure/io"]
data_format = "grok"
grok_patterns = [
"%{NOTSPACE:type:tag} avg10=%{NUMBER:avg10:float} avg60=%{NUMBER:avg60:float} avg300=%{NUMBER:avg300:float} total=%{NUMBER:total:int}"
]
[[inputs.file]]
name_override = "pressure_memory"
# interval = "5s"
files = ["/proc/pressure/memory"]
data_format = "grok"
grok_patterns = [
"%{NOTSPACE:type:tag} avg10=%{NUMBER:avg10:float} avg60=%{NUMBER:avg60:float} avg300=%{NUMBER:avg300:float} total=%{NUMBER:total:int}"
]
@mjf
Copy link
Author

mjf commented Jun 23, 2022

On RHEL-based distros rename the file to /etc/telegraf/telegraf.d/psi.conf, test it and reload Telegraf.

@mjf
Copy link
Author

mjf commented Jun 24, 2022

On other distros ensure that /proc/pressure/* exists. If not then grep PSI /path/to/kernel/config. If enabled the default may be off. Enable it by psi=1 on Linux command line (in Grub etc.) and reboot.

The feature is present on Linux v4.20 on.

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