tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
cortex-tools: init at 0.11.3
Thibaut Smith
6 months ago
822dba5c
1454ae08
+79
1 changed file
expand all
collapse all
unified
split
pkgs
by-name
co
cortex-tools
package.nix
+79
pkgs/by-name/co/cortex-tools/package.nix
···
1
1
+
{
2
2
+
lib,
3
3
+
buildGoModule,
4
4
+
fetchFromGitHub,
5
5
+
gitUpdater,
6
6
+
versionCheckHook,
7
7
+
installShellFiles,
8
8
+
stdenv,
9
9
+
nix-update-script,
10
10
+
}:
11
11
+
buildGoModule (finalAttrs: {
12
12
+
pname = "cortex-tools";
13
13
+
version = "0.11.3";
14
14
+
15
15
+
src = fetchFromGitHub {
16
16
+
owner = "grafana";
17
17
+
repo = "cortex-tools";
18
18
+
tag = "v${finalAttrs.version}";
19
19
+
hash = "sha256-+GWUC+lnCn5Nw2WytSvW/UsIMmMelCCsnKdBCHuue24=";
20
20
+
};
21
21
+
22
22
+
vendorHash = null;
23
23
+
24
24
+
subPackages = [
25
25
+
"cmd/benchtool"
26
26
+
"cmd/cortextool"
27
27
+
"cmd/e2ealerting"
28
28
+
"cmd/logtool"
29
29
+
];
30
30
+
31
31
+
env.CGO_ENABLED = 0;
32
32
+
33
33
+
ldflags = [
34
34
+
"-X github.com/grafana/cortex-tools/pkg/version.Version=${finalAttrs.src.tag}"
35
35
+
"-s"
36
36
+
"-w"
37
37
+
];
38
38
+
39
39
+
doCheck = true;
40
40
+
41
41
+
passthru.updateScript = nix-update-script { };
42
42
+
43
43
+
nativeBuildInputs = [ installShellFiles ];
44
44
+
45
45
+
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
46
46
+
installShellCompletion --cmd cortextool \
47
47
+
--bash <($out/bin/cortextool --completion-script-bash) \
48
48
+
--zsh <($out/bin/cortextool --completion-script-zsh)
49
49
+
50
50
+
$out/bin/cortextool --help-man > cortextool.1
51
51
+
installManPage cortextool.1
52
52
+
'';
53
53
+
54
54
+
doInstallCheck = true;
55
55
+
56
56
+
nativeInstallCheckInputs = [
57
57
+
versionCheckHook
58
58
+
];
59
59
+
60
60
+
versionCheckProgramArg = "version";
61
61
+
62
62
+
meta = {
63
63
+
changelog = "https://github.com/grafana/cortex-tools/releases/tag/${finalAttrs.src.tag}";
64
64
+
description = "Tools used for interacting with Cortex, a Prometheus-compatible server";
65
65
+
longDescription = ''
66
66
+
Tools used for interacting with Cortex, a horizontally scalable, highly available, multi-tenant, long term Prometheus server:
67
67
+
68
68
+
- benchtool: A powerful YAML driven tool for benchmarking Cortex write and query API.
69
69
+
- cortextool: Interacts with user-facing Cortex APIs and backend storage components.
70
70
+
- logtool: Tool which parses Cortex query-frontend logs and formats them for easy analysis.
71
71
+
- e2ealerting: Tool that helps measure how long an alert takes from scrape of sample to Alertmanager notification delivery.
72
72
+
'';
73
73
+
homepage = "https://github.com/grafana/cortex-tools";
74
74
+
license = lib.licenses.asl20;
75
75
+
platforms = lib.platforms.linux ++ lib.platforms.windows ++ lib.platforms.darwin;
76
76
+
maintainers = with lib.maintainers; [ videl ];
77
77
+
mainProgram = "cortextool";
78
78
+
};
79
79
+
})