From c8eb59176a6afa55009ab57c340cf5be9f40c8ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Mon, 17 Jan 2022 15:26:01 +0100 Subject: [PATCH] Fix the minio node exporter --- config/services/minio.nix | 4 ---- config/services/prometheus.nix | 13 +++++++++++++ config/sops.nix | 1 + secrets/nixos-8gb-fsn1-1/secrets.yaml | 5 +++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/config/services/minio.nix b/config/services/minio.nix index 64f9ef38..f3523d75 100644 --- a/config/services/minio.nix +++ b/config/services/minio.nix @@ -13,10 +13,6 @@ in "/var/lib/minio/disk3" ]; }; - services.prometheus.exporters.minio = { - # TODO: doesn't work - enable = true; - }; services.nginx.virtualHosts."minio.int.chir.rs" = { forceSSL = true; http2 = true; diff --git a/config/services/prometheus.nix b/config/services/prometheus.nix index b028aa27..34edb9b6 100644 --- a/config/services/prometheus.nix +++ b/config/services/prometheus.nix @@ -43,6 +43,19 @@ ]; }]; } + { + job_name = "minio_exporter"; + bearer_token_file = "/run/secrets/services/minio_scrape"; + metrics_path = "/minio/v0/metrics/cluster"; + scheme = "https"; + static_configs = [ + { + targets = [ + "minio.int.chir.rs" + ]; + } + ]; + } ]; }; } diff --git a/config/sops.nix b/config/sops.nix index e316d4ba..cd9c7cc7 100644 --- a/config/sops.nix +++ b/config/sops.nix @@ -7,4 +7,5 @@ sops.secrets."security/restic/password" = { }; sops.secrets."security/minio/credentials_file" = { }; sops.secrets."services/gitea.nix" = { }; + sops.secrets."services/minio_scrape" = { }; } diff --git a/secrets/nixos-8gb-fsn1-1/secrets.yaml b/secrets/nixos-8gb-fsn1-1/secrets.yaml index 480d9360..4e6cecb2 100644 --- a/secrets/nixos-8gb-fsn1-1/secrets.yaml +++ b/secrets/nixos-8gb-fsn1-1/secrets.yaml @@ -10,6 +10,7 @@ security: credentials_file: ENC[AES256_GCM,data:ZmdxboXeY7cbQ5b9h5JKO4uewTZC8XCbg9T8KvCA9afjwWjruuoHZ/LcXgEphdwuBB6CpcRqMze+21fT16svqUgLgVcCRLmtx7E=,iv:s2b4KtQM1fkMVxAAGD5sSOkum9Lhcy1khV8GabbhFXQ=,tag:aHL4SUuOwzU5V9Wz6otS0g==,type:str] services: gitea.nix: ENC[AES256_GCM,data:51YBcqkQJFbvJEZ7U9Fr6YPqtF6Sn+huLKPQHXoIFlrhlSTZDtGpPci1MQVI7X/UWSpdCTtOa22doguWEqWG9rUaekfmDTL8jb/WbV7jtDYnFINE1NRRFb/RIFmQJ/UPODsesewtg8vNPiU9ZAQgep9ttPMpqnRWkEHcFisTrHO1gZ0D6pF2EFbBEZX3Z5q7rPcr5907KiF0HALFueVqzONGCYGxmzBIFWA8Um1wYKlwWieqjos60Ip2,iv:wMOKydq0NLazAQC3joFTyhbmEIvwDGFc4sEhcQ3a/gc=,tag:c5MndmKCjBm7u63R9VWwgA==,type:str] + minio_scrape: ENC[AES256_GCM,data:Kk4HMqMMfAlfrJf81rdgaQVClzYz8di8+qTjRfR/V+QV19aqlhyYtW2Y9XirntwNiD5OIjyunxd6uI+WsKg5DRpenG5o4KjPXjU7e5WoyOIBDnUAIFnnW5WAZkVrBK2jeX2DU4dFz16MRRp6JSDCDiw4xnvSu10FTbSvcAFmLzcNzRUvGR28CIdX/8eyZL3RORMueDJ4zuy9siGgQiWkG3M3UA1g/hFGukyS2GiQkrJ9/68VdkpJtqqV7w29m5hw2Z9c9A==,iv:kTeWuWHRvgLryK4F/2oEvwwu3BFPHV54jXsYEk1anmw=,tag:rUVrVWAC7K8mvn+rRlbsxA==,type:str] sops: kms: [] gcp_kms: [] @@ -34,8 +35,8 @@ sops: QkkzbUVrVWtYMWhLa0N5MzJ2KzV4MW8KEAtd2cnwNH01rYUFr+qWyAhHvUsqsxXg not2RQLEIGbo80Z7CMIwqCIpUYOL4m70KlEKrFzflXFbOFX2en82iA== -----END AGE ENCRYPTED FILE----- - lastmodified: "2022-01-17T10:56:43Z" - mac: ENC[AES256_GCM,data:Dmax5XHjWvWX3g0/J12Vv4Ibe2wDiZu+crRtZYLq5UMG7NS2hpFYIeEJMcP2+GwzbQfN105BFp8Wg+si+cp0scpOMpiIzy9ADKKDY3LZA47baxOabFvZRqx9N+13OOipZOypVKiUOkpVn27efwYE89EGn76Ph7wy4QXreieBV3c=,iv:xgWtrL1B0whKfJCCfOOkyuTcLXqwgwn67ncLrRRS3DI=,tag:kJRyC8gc1SdALoGjJAHMnw==,type:str] + lastmodified: "2022-01-17T14:23:04Z" + mac: ENC[AES256_GCM,data:Ze02BteXZ2k7B7tcdd8dCEqSGy0LcISh9DXFoe8nSZwG8Hfc2u/iUCxv8JLXhbMFI1BZypkyknOq4YAjwZXSuQ1MZhN2yS0j3B8PeirJOMlV5gz1MI03JdtIHJrHIgaFQjesOdQL2Gth77E3uV7Z75nx9OYQKMZ8Gv4GbOTozi0=,iv:ssbj/+73S5FFYf8j1vOFP5rrw9jyAk7W/F00IVGonHc=,tag:Dg6hRLN98Qh5psbAbd8+gg==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.7.1