This commit is contained in:
Robin Appelman 2025-06-02 20:47:04 +02:00
commit 2f5cc229f3
5 changed files with 67 additions and 60 deletions

View file

@ -13,7 +13,9 @@ Opinionated system metrics exporter for prometheus
## Usage ## Usage
- Download the binary for your architecture from the [releases](https://github.com/icewind1991/palantir/releases/) and place it at `/usr/local/bin/palantir` - Download the binary for your architecture from the
[releases](https://github.com/icewind1991/palantir/releases/) and place it at
`/usr/local/bin/palantir`
- Place the [palantir.service](palantir.service) file in `/etc/systemd/system/` - Place the [palantir.service](palantir.service) file in `/etc/systemd/system/`
- Create the `palantir` user: `sudo useradd -m palantir` - Create the `palantir` user: `sudo useradd -m palantir`
- Start enable enable the server: `sudo systemctl enable --now palantir` - Start enable enable the server: `sudo systemctl enable --now palantir`
@ -23,8 +25,10 @@ Some stats require additional permissions described below.
## Power monitoring permissions ## Power monitoring permissions
In recent kernel versions, precise power monitoring is only accessible to root users to prevent using it as a side-channel attack. In recent kernel versions, precise power monitoring is only accessible to root
In order to get the power monitoring output you'll need to give the `palantir` user access to this data using the following steps. users to prevent using it as a side-channel attack. In order to get the power
monitoring output you'll need to give the `palantir` user access to this data
using the following steps.
- Create a group using - Create a group using
@ -59,7 +63,8 @@ In order to get the power monitoring output you'll need to give the `palantir` u
## Docker monitoring permissions ## Docker monitoring permissions
To enable monitoring of docker containers, add the `palantir` user to the `docker` group To enable monitoring of docker containers, add the `palantir` user to the
`docker` group
```bash ```bash
sudo usermod -a -G docker palantir sudo usermod -a -G docker palantir
@ -67,4 +72,6 @@ sudo usermod -a -G docker palantir
## Windows support ## Windows support
Palantir has limited windows support out of the box, additional sensors can be enabled by running [LibreHardwareMonitor](https://github.com/LibreHardwareMonitor/LibreHardwareMonitor). Palantir has limited windows support out of the box, additional sensors can be
enabled by running
[LibreHardwareMonitor](https://github.com/LibreHardwareMonitor/LibreHardwareMonitor).

View file

@ -10,7 +10,8 @@
inputs.flakelight.follows = "flakelight"; inputs.flakelight.follows = "flakelight";
}; };
}; };
outputs = { mill-scale, ... }: mill-scale ./. { outputs = {mill-scale, ...}:
mill-scale ./. {
packages.palantir = import ./package.nix; packages.palantir = import ./package.nix;
crossTargets = [ crossTargets = [
@ -22,11 +23,11 @@
]; ];
nixosModules = {outputs, ...}: { nixosModules = {outputs, ...}: {
default = default = {
{ pkgs pkgs,
, config config,
, lib lib,
, ... ...
}: { }: {
imports = [./module.nix]; imports = [./module.nix];
config = lib.mkIf config.services.palantir.enable { config = lib.mkIf config.services.palantir.enable {

View file

@ -1,12 +1,12 @@
{ config {
, lib config,
, pkgs lib,
, ... pkgs,
...
}: }:
with lib; let with lib; let
cfg = config.services.palantir; cfg = config.services.palantir;
in in {
{
options.services.palantir = { options.services.palantir = {
enable = mkEnableOption "Enables the palantir service"; enable = mkEnableOption "Enables the palantir service";

View file

@ -1,10 +1,9 @@
{ stdenv {
, rustPlatform stdenv,
, coreutils rustPlatform,
, lib coreutils,
, lib,
}: }: let
let
inherit (lib.sources) sourceByRegex; inherit (lib.sources) sourceByRegex;
inherit (builtins) fromTOML readFile; inherit (builtins) fromTOML readFile;
src = sourceByRegex ./. ["Cargo.*" "(src|benches)(/.*)?"]; src = sourceByRegex ./. ["Cargo.*" "(src|benches)(/.*)?"];