mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
fix(monitoring): loki grpc port
This commit is contained in:
parent
3f33177ae5
commit
c8e5c6f4bf
2 changed files with 29 additions and 4 deletions
|
|
@ -139,11 +139,33 @@ in
|
||||||
assertion = config.ports.default.port == nixosConfig.services.loki.settings.httpListenPort;
|
assertion = config.ports.default.port == nixosConfig.services.loki.settings.httpListenPort;
|
||||||
message = "port mismatch";
|
message = "port mismatch";
|
||||||
})
|
})
|
||||||
|
(nixosConfig: let
|
||||||
|
inherit (nixosConfig.services.loki.settings) grpcListenPort;
|
||||||
|
in {
|
||||||
|
assertion = !config.ports.grpc.enable || config.ports.grpc.port == grpcListenPort;
|
||||||
|
message = "gRPC port mismatch";
|
||||||
|
})
|
||||||
|
(nixosConfig: let
|
||||||
|
inherit (nixosConfig.services.loki.settings) grpcListenPort;
|
||||||
|
in {
|
||||||
|
assertion = if config.ports.grpc.enable
|
||||||
|
then grpcListenPort != 0
|
||||||
|
else grpcListenPort == 0;
|
||||||
|
message = "gRPC enable mismatch";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
ports.default = mapAlmostOptionDefaults {
|
ports = {
|
||||||
port = 9093;
|
default = mapAlmostOptionDefaults {
|
||||||
protocol = "http";
|
port = 9093;
|
||||||
|
protocol = "http";
|
||||||
|
};
|
||||||
|
grpc = mapAlmostOptionDefaults {
|
||||||
|
enable = false;
|
||||||
|
port = 9095;
|
||||||
|
protocol = "http";
|
||||||
|
};
|
||||||
|
#grpclb.port = 9096;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
promtail = {config, ...}: {
|
promtail = {config, ...}: {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,10 @@ in {
|
||||||
};
|
};
|
||||||
networking.firewall.interfaces.lan.allowedTCPPorts = mkMerge [
|
networking.firewall.interfaces.lan.allowedTCPPorts = mkMerge [
|
||||||
(mkIf grafana.enable [ grafana.port ])
|
(mkIf grafana.enable [ grafana.port ])
|
||||||
(mkIf loki.enable [ loki.settings.httpListenPort loki.settings.grpcListenPort ])
|
(mkIf loki.enable [
|
||||||
|
loki.settings.httpListenPort
|
||||||
|
(mkIf (loki.settings.grpcListenPort != 0) loki.settings.grpcListenPort)
|
||||||
|
])
|
||||||
(mkIf prometheus.enable [ prometheus.port ])
|
(mkIf prometheus.enable [ prometheus.port ])
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue