close firewall on prometheus

This commit is contained in:
Philipp Hochkamp 2022-08-09 02:06:28 +02:00
parent 5c5202f4d7
commit 5b8e13008a
3 changed files with 9 additions and 11 deletions

View file

@ -3,14 +3,12 @@ hostname = "ds9"
ip = "100.83.96.25" # tailscale
[hostOverrides]
wormhole = "10.0.0.1"
picard = "ragon.xyz"
#[exporters.nginx]
#hosts = [
# "ds9",
# "wormhole"
#]
[exporters.nginx]
hosts = [
"ds9",
"picard"
]
[exporters.node]
hosts = [ "ds9", "picard" ]

View file

@ -70,7 +70,7 @@
"~(?P<ip>.*)" $ip;
}
log_format anonymized '$ip_anonymized - $remote_user [$time_local] '
log_format anonymized '$ip_anonymized - - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';

View file

@ -11,7 +11,7 @@ let
(
if (builtins.elem y (builtins.attrNames cfg.hostOverrides))
then cfg.hostOverrides.${y}
else "${y}.hailsatan.eu"
else y
)
);
in
@ -124,7 +124,7 @@ in
services.prometheus.exporters.nginxlog.settings = {
namespaces = [{
name = "nginx";
format = "$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\"";
format = "$remote_addr - - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\"";
source.files = [ "/var/log/nginx/access.log" ];
}];
};
@ -135,7 +135,7 @@ in
configuration = {
server.http_listen_port = 28183;
positions.filename = "/tmp/positions.yaml";
clients = [{ url = "http://${getHost cfg.master.hostname}:3100/loki/api/v1/push"; }];
clients = [{ url = "http://${cfg.master.ip}:3100/loki/api/v1/push"; }];
scrape_configs = [
{
job_name = "journal";