Add Loki
This commit is contained in:
parent
f9272748f1
commit
3d7d552492
8 changed files with 40 additions and 3 deletions
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
8
home/etc/containers/systemd/loki.container
Normal file
8
home/etc/containers/systemd/loki.container
Normal 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
|
0
home/etc/containers/systemd/loki.volume
Normal file
0
home/etc/containers/systemd/loki.volume
Normal 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
|
||||
|
|
0
server/etc/containers/systemd/alloy.volume
Normal file
0
server/etc/containers/systemd/alloy.volume
Normal 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
|
||||
|
|
Loading…
Add table
Reference in a new issue