Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hydra: ?compare=1400181
- Loading branch information
Showing
30 changed files
with
448 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 117 additions & 0 deletions
117
nixos/modules/services/monitoring/prometheus/minio-exporter.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{ config, pkgs, lib, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.services.prometheus.minioExporter; | ||
in { | ||
options = { | ||
services.prometheus.minioExporter = { | ||
enable = mkEnableOption "prometheus minio exporter"; | ||
|
||
port = mkOption { | ||
type = types.int; | ||
default = 9290; | ||
description = '' | ||
Port to listen on. | ||
''; | ||
}; | ||
|
||
listenAddress = mkOption { | ||
type = types.nullOr types.str; | ||
default = null; | ||
example = "0.0.0.0"; | ||
description = '' | ||
Address to listen on for web interface and telemetry. | ||
''; | ||
}; | ||
|
||
minioAddress = mkOption { | ||
type = types.str; | ||
example = "https://10.0.0.1:9000"; | ||
default = if config.services.minio.enable then "http://localhost:9000" else null; | ||
description = '' | ||
The URL of the minio server. | ||
Use HTTPS if Minio accepts secure connections only. | ||
By default this connects to the local minio server if enabled. | ||
''; | ||
}; | ||
|
||
minioAccessKey = mkOption ({ | ||
type = types.str; | ||
example = "BKIKJAA5BMMU2RHO6IBB"; | ||
description = '' | ||
The value of the Minio access key. | ||
It is required in order to connect to the server. | ||
By default this uses the one from the local minio server if enabled | ||
and <literal>config.services.minio.accessKey</literal>. | ||
''; | ||
} // optionalAttrs (config.services.minio.enable && config.services.minio.accessKey != "") { | ||
default = config.services.minio.accessKey; | ||
}); | ||
|
||
minioAccessSecret = mkOption ({ | ||
type = types.str; | ||
description = '' | ||
The calue of the Minio access secret. | ||
It is required in order to connect to the server. | ||
By default this uses the one from the local minio server if enabled | ||
and <literal>config.services.minio.secretKey</literal>. | ||
''; | ||
} // optionalAttrs (config.services.minio.enable && config.services.minio.secretKey != "") { | ||
default = config.services.minio.secretKey; | ||
}); | ||
|
||
minioBucketStats = mkOption { | ||
type = types.bool; | ||
default = false; | ||
description = '' | ||
Collect statistics about the buckets and files in buckets. | ||
It requires more computation, use it carefully in case of large buckets.. | ||
''; | ||
}; | ||
|
||
extraFlags = mkOption { | ||
type = types.listOf types.str; | ||
default = []; | ||
description = '' | ||
Extra commandline options when launching the minio exporter. | ||
''; | ||
}; | ||
|
||
openFirewall = mkOption { | ||
type = types.bool; | ||
default = false; | ||
description = '' | ||
Open port in firewall for incoming connections. | ||
''; | ||
}; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
networking.firewall.allowedTCPPorts = optional cfg.openFirewall cfg.port; | ||
|
||
systemd.services.prometheus-minio-exporter = { | ||
description = "Prometheus exporter for Minio server metrics"; | ||
unitConfig.Documentation = "https://github.com/joe-pll/minio-exporter"; | ||
wantedBy = [ "multi-user.target" ]; | ||
after = optional config.services.minio.enable "minio.service"; | ||
serviceConfig = { | ||
DynamicUser = true; | ||
Restart = "always"; | ||
PrivateTmp = true; | ||
WorkingDirectory = /tmp; | ||
ExecStart = '' | ||
${pkgs.prometheus-minio-exporter}/bin/minio-exporter \ | ||
-web.listen-address ${optionalString (cfg.listenAddress != null) cfg.listenAddress}:${toString cfg.port} \ | ||
-minio.server ${cfg.minioAddress} \ | ||
-minio.access-key ${cfg.minioAccessKey} \ | ||
-minio.access-secret ${cfg.minioAccessSecret} \ | ||
${optionalString cfg.minioBucketStats "-minio.bucket-stats"} \ | ||
${concatStringsSep " \\\n " cfg.extraFlags} | ||
''; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,5 +59,7 @@ in { | |
}; | ||
|
||
services.keybase.enable = true; | ||
|
||
environment.systemPackages = [ pkgs.kbfs ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ stdenv, fetchFromGitHub, cmake }: | ||
|
||
stdenv.mkDerivation rec { | ||
name = "hotpatch-0.2"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "vikasnkumar"; | ||
repo = "hotpatch"; | ||
rev = "4b65e3f275739ea5aa798d4ad083c4cb10e29149"; | ||
sha256 = "169vdh55wsbn6fl58lpzqx64v6ifzh7krykav33x1d9hsk98qjqh"; | ||
}; | ||
|
||
enableParallelBuilding = true; | ||
doCheck = true; | ||
|
||
nativeBuildInputs = [ cmake ]; | ||
|
||
preConfigure = '' | ||
substituteInPlace test/loader.c \ | ||
--replace \"/lib64/ld-linux-x86-64.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \ | ||
--replace \"/lib/ld-linux-x86-64.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \ | ||
--replace \"/lib/ld-linux.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \ | ||
--replace \"/lib32/ld-linux.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" | ||
''; | ||
|
||
checkPhase = '' | ||
LD_LIBRARY_PATH=$(pwd)/src make test | ||
''; | ||
|
||
meta = with stdenv.lib; { | ||
description = "Hot patching executables on Linux using .so file injection"; | ||
homepage = src.meta.homepage; | ||
license = licenses.bsd3; | ||
maintainers = [ maintainers.gnidorah ]; | ||
platforms = ["i686-linux" "x86_64-linux"]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.