Add Prometheus/Grafana monitoring
All checks were successful
ShellCheck / shellcheck (push) Successful in 23s
All checks were successful
ShellCheck / shellcheck (push) Successful in 23s
This commit is contained in:
parent
25327c4029
commit
de65370925
13 changed files with 74 additions and 7 deletions
|
@ -5,7 +5,7 @@ jobs:
|
|||
runs-on: debian-12
|
||||
steps:
|
||||
- name: Install ShellCheck
|
||||
run: apt-get update && apt-get install shellcheck
|
||||
run: apt-get update && apt-get install -y shellcheck
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Run ShellCheck
|
||||
|
|
15
container-config/alloy/config.alloy
Normal file
15
container-config/alloy/config.alloy
Normal file
|
@ -0,0 +1,15 @@
|
|||
prometheus.exporter.unix "local" {
|
||||
rootfs_path = "/run/host"
|
||||
}
|
||||
prometheus.scrape "scraper" {
|
||||
targets = prometheus.exporter.unix.local.targets
|
||||
forward_to [prometheus.remote_write.writer.receiver]
|
||||
prometheus.remote_write "writer" {
|
||||
endpoint {
|
||||
url = "https://metrics.strypsteen.com/api/v1/write"
|
||||
basic_auth {
|
||||
username = "admin"
|
||||
password = env("PROMETHEUS_PASSWORD")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,7 +17,6 @@
|
|||
"files.trimFinalNewlines": true,
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"git.confirmSync": false,
|
||||
"github.gitAuthentication": false,
|
||||
"search.smartCase": true,
|
||||
"workbench.colorTheme": "Default Dark Modern",
|
||||
"workbench.settings.enableNaturalLanguageSearch": false,
|
||||
|
|
11
container-config/nginx-home/metrics
Normal file
11
container-config/nginx-home/metrics
Normal file
|
@ -0,0 +1,11 @@
|
|||
server {
|
||||
server_name metrics.strypsteen.com;
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
include snippets/headers.conf;
|
||||
location / {
|
||||
set $upstream systemd-prometheus.:9090;
|
||||
proxy_pass http://$upstream;
|
||||
include snippets/proxy.conf;
|
||||
}
|
||||
}
|
16
container-config/nginx-home/monitoring
Normal file
16
container-config/nginx-home/monitoring
Normal file
|
@ -0,0 +1,16 @@
|
|||
server {
|
||||
server_name monitoring.strypsteen.com;
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
deny 10.0.0.1;
|
||||
deny fd00::1;
|
||||
include snippets/headers.conf;
|
||||
location / {
|
||||
set $upstream systemd-grafana.:3000;
|
||||
proxy_pass http://$upstream;
|
||||
include snippets/proxy.conf;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection upgrade;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
}
|
||||
}
|
0
container-config/prometheus/prometheus.yml
Normal file
0
container-config/prometheus/prometheus.yml
Normal file
|
@ -1,5 +0,0 @@
|
|||
re:protocol-command-decode
|
||||
re:not-suspicious
|
||||
re:misc-activity
|
||||
re:misc-attack
|
||||
re:bad-unknown
|
7
home/etc/containers/systemd/grafana.container
Normal file
7
home/etc/containers/systemd/grafana.container
Normal file
|
@ -0,0 +1,7 @@
|
|||
[Container]
|
||||
Image=cgr.dev/chainguard/grafana
|
||||
Network=nginx.network
|
||||
Volume=grafana.volume:/var/lib/grafana:U,Z
|
||||
AutoUpdate=registry
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
0
home/etc/containers/systemd/grafana.volume
Normal file
0
home/etc/containers/systemd/grafana.volume
Normal file
10
home/etc/containers/systemd/prometheus.container
Normal file
10
home/etc/containers/systemd/prometheus.container
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Container]
|
||||
Image=cgr.dev/chainguard/prometheus
|
||||
Network=nginx.network
|
||||
Exec=--web.config.file=/run/secrets/prometheus-config --web.enable-remote-write-receiver
|
||||
Volume=/var/lib/system-config/container-config/prometheus/prometheus.yml:/prometheus.yml:z,ro
|
||||
Volume=prometheus.volume:/data:U,Z
|
||||
Secret=prometheus-config
|
||||
AutoUpdate=registry
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
0
home/etc/containers/systemd/prometheus.volume
Normal file
0
home/etc/containers/systemd/prometheus.volume
Normal file
12
server/etc/containers/systemd/alloy.container
Normal file
12
server/etc/containers/systemd/alloy.container
Normal file
|
@ -0,0 +1,12 @@
|
|||
[Container]
|
||||
Image=docker.io/grafana/alloy
|
||||
PodmanArgs=--pid=host
|
||||
Unmask=ALL
|
||||
Network=host
|
||||
Volume=/var/lib/system-config/container-config/alloy/config.alloy:/etc/alloy/config.alloy:z,ro
|
||||
Volume=/:/run/host:ro
|
||||
Tmpfs=/var/lib/alloy
|
||||
Secret=PROMETHEUS_PASSWORD,type=env
|
||||
AutoUpdate=registry
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -8,6 +8,8 @@ set system static-host-mapping host-name home.strypsteen.com alias element.stryp
|
|||
set system static-host-mapping host-name home.strypsteen.com alias git.strypsteen.com
|
||||
set system static-host-mapping host-name home.strypsteen.com alias llm.strypsteen.com
|
||||
set system static-host-mapping host-name home.strypsteen.com alias matrix.strypsteen.com
|
||||
set system static-host-mapping host-name home.strypsteen.com alias metrics.strypsteen.com
|
||||
set system static-host-mapping host-name home.strypsteen.com alias monitoring.strypsteen.com
|
||||
set system static-host-mapping host-name home.strypsteen.com alias network.strypsteen.com
|
||||
set system static-host-mapping host-name home.strypsteen.com alias office.strypsteen.com
|
||||
set system static-host-mapping host-name home.strypsteen.com alias remote-desktop.strypsteen.com
|
||||
|
|
Loading…
Add table
Reference in a new issue