mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-12-10 03:49:44 +00:00
feat(y2q): add prometheus
This commit is contained in:
parent
c10916f47a
commit
18997b1fef
1 changed files with 25 additions and 0 deletions
25
home/modules/runit/services/prometheus.nix
Normal file
25
home/modules/runit/services/prometheus.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
{ pkgs, config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
home.file.".config/prometheus/prometheus.yml".text = ''
|
||||||
|
global:
|
||||||
|
scrape_interval: 1m
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: 'restic_rest_server'
|
||||||
|
static_configs:
|
||||||
|
- targets: ['${config.runit.services.restic-rest-server.environment.LISTEN_ADDR}']
|
||||||
|
'';
|
||||||
|
|
||||||
|
runit.services.prometheus = {
|
||||||
|
script = ''
|
||||||
|
TSDB_PATH=$HOME/services/prometheus
|
||||||
|
mkdir -p TSDB_PATH
|
||||||
|
|
||||||
|
exec ${pkgs.prometheus}/bin/prometheus \
|
||||||
|
--config.file=$HOME/.config/prometheus/prometheus.yml \
|
||||||
|
--storage.tsdb.path=$TSDB_PATH \
|
||||||
|
--web.listen-address="127.0.0.1:9090"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue