mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
nixos/thanos: assert that prometheus2 is running and has labels set
This commit is contained in:
parent
7f093a2e8e
commit
e32e0e6e02
1 changed files with 15 additions and 0 deletions
|
@ -661,6 +661,21 @@ in {
|
|||
config = mkMerge [
|
||||
|
||||
(mkIf cfg.sidecar.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = config.services.prometheus2.enable;
|
||||
message =
|
||||
"Please enable services.prometheus2 when enabling services.thanos.sidecar.";
|
||||
}
|
||||
{
|
||||
assertion = !(config.services.prometheus2.globalConfig.external_labels == null ||
|
||||
config.services.prometheus2.globalConfig.external_labels == {});
|
||||
message =
|
||||
"services.thanos.sidecar requires uniquely identifying external labels " +
|
||||
"to be configured in the Prometheus server. " +
|
||||
"Please set services.prometheus2.globalConfig.external_labels.";
|
||||
}
|
||||
];
|
||||
systemd.services.thanos-sidecar = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" "prometheus2.service" ];
|
||||
|
|
Loading…
Reference in a new issue