This commit is contained in:
Mathieu Strypsteen 2024-09-01 15:41:26 +02:00
parent f9272748f1
commit 3d7d552492
Signed by: mathieu
GPG key ID: 782A42E461BC6824
8 changed files with 40 additions and 3 deletions

View file

@ -16,3 +16,24 @@ prometheus.remote_write "writer" {
}
}
}
loki.source.journal "journald" {
path = "/run/host/var/log/journal"
relabel_rules = loki.relabel.journald.rules
forward_to = [loki.write.writer.receiver]
}
loki.relabel "journald" {
rule {
source_labels = ["__journal__systemd_unit"]
target_label = "unit"
}
rule {
source_labels = ["__journal_priority_keyword"]
target_label = "level"
}
forward_to = []
}
loki.write "writer" {
endpoint {
url = "https://metrics.strypsteen.com/loki/api/v1/push"
}
}

View file

@ -8,4 +8,9 @@ server {
proxy_pass http://$upstream;
include snippets/proxy.conf;
}
location = /loki/api/v1/push {
set $upstream systemd-loki.:3100;
proxy_pass http://$upstream;
include snippets/proxy.conf;
}
}

View file

@ -2,7 +2,9 @@
Image=docker.io/grafana/grafana-oss
Network=nginx.network
Volume=grafana.volume:/var/lib/grafana:U,Z
Environment=GF_ANALYTICS_REPORTING_ENABLED=false
Environment=GF_DATABASE_WAL=true
Environment=GF_LOG_LEVEL=warn
Environment=GF_SERVER_ROOT_URL=https://monitoring.strypsteen.com
Environment=GF_SMTP_ENABLED=true
Environment=GF_SMTP_HOST=vps.strypsteen.com:465

View file

@ -0,0 +1,8 @@
[Container]
Image=docker.io/grafana/loki
Network=nginx.network
Exec=-config.file=/etc/loki/local-config.yaml -log.level=warn -reporting.enabled=false
Volume=loki.volume:/loki:U,Z
AutoUpdate=registry
[Install]
WantedBy=multi-user.target

View file

View file

@ -5,6 +5,7 @@ UserNS=host
Unmask=ALL
Network=host
Volume=/var/lib/system-config/container-config/alloy/config.alloy:/etc/alloy/config.alloy:z,ro
Volume=alloy.volume:/var/lib/alloy/data:U,Z
Volume=/:/run/host:ro
Volume=/run/systemd:/run/systemd
Tmpfs=/var/lib/alloy

View file

@ -35,13 +35,13 @@ set service dhcp-server shared-network-name mgmt option name-server 192.168.255.
set service dhcp-server shared-network-name mgmt subnet 192.168.255.0/24 subnet-id 1
set service dhcp-server shared-network-name mgmt subnet 192.168.255.0/24 range 0 start 192.168.255.2
set service dhcp-server shared-network-name mgmt subnet 192.168.255.0/24 range 0 stop 192.168.255.254
set service dhcp-server shared-network-name mgmt subnet 192.168.255.0/24 lease 600
set service dhcp-server shared-network-name mgmt subnet 192.168.255.0/24 lease 1800
set service dhcp-server shared-network-name lan option default-router 192.168.254.1
set service dhcp-server shared-network-name lan option name-server 192.168.254.1
set service dhcp-server shared-network-name lan subnet 192.168.254.0/24 subnet-id 2
set service dhcp-server shared-network-name lan subnet 192.168.254.0/24 range 0 start 192.168.254.2
set service dhcp-server shared-network-name lan subnet 192.168.254.0/24 range 0 stop 192.168.254.254
set service dhcp-server shared-network-name lan subnet 192.168.254.0/24 lease 600
set service dhcp-server shared-network-name lan subnet 192.168.254.0/24 lease 1800
set service dhcp-server shared-network-name server option bootfile-name netboot.xyz.efi
set service dhcp-server shared-network-name server option bootfile-server 192.168.253.1
set service dhcp-server shared-network-name server option default-router 192.168.253.1
@ -50,7 +50,7 @@ set service dhcp-server shared-network-name server option name-server 192.168.25
set service dhcp-server shared-network-name server subnet 192.168.253.0/24 subnet-id 3
set service dhcp-server shared-network-name server subnet 192.168.253.0/24 range 0 start 192.168.253.3
set service dhcp-server shared-network-name server subnet 192.168.253.0/24 range 0 stop 192.168.253.253
set service dhcp-server shared-network-name server subnet 192.168.253.0/24 lease 600
set service dhcp-server shared-network-name server subnet 192.168.253.0/24 lease 1800
set service router-advert interface eth1 prefix ::/64
set service router-advert interface eth2 prefix ::/64
set service router-advert interface eth3 prefix ::/64