Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions application.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,44 @@ rec {
group = "users";
};

playos.monitoring.enable = true;
playos.monitoring.extraServices = [ "dividat-driver.service" ];

systemd.services.telegraf.path = with pkgs; [ procps ]; # pgrep for procstat

# track the memory and cpu usage of processes started in the X11 session
# (kiosk, qtwebengine and anything else)
services.telegraf.extraConfig = {
inputs.procstat = [{
properties = [ "cpu" "memory" ];

taginclude = [ "process_name" ]; # not unique!
fieldinclude = [
"pid" # Note: PID is a field, not a tag, to avoid tag cardinality
# growth due to restarts.
"cpu_time_iowait"
"cpu_usage"
"memory_rss"
"memory_shared"
];

filter = [{
name = "session-procs";
cgroups = [ "/sys/fs/cgroup/user.slice/user-*.slice/session-*.scope" ];
users = [ "play" ];
}];

}];

processors.strings = [{
left = [{
tag = "process_name";
width = 64; # trim process_names to at most 64 chars to avoid very long tag names
}];
}];

};

# Limit virtual terminals that can be switched to
# Virtual terminal 7 is the kiosk, 8 is the status screen
playos.xserver.activeVirtualTerminals = [ 7 8 ];
Expand Down
1 change: 1 addition & 0 deletions base/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ with lib;
./system-partition.nix
./volatile-root.nix
./compatibility
./monitoring.nix
];

options = {
Expand Down
Loading