-
Notifications
You must be signed in to change notification settings - Fork 3
/
prometheus-folder-size-exporter.nix
39 lines (33 loc) · 1.17 KB
/
prometheus-folder-size-exporter.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# [prometheus-folder-size-exporter](https://github.com/MindFlavor/prometheus_folder_size_exporter) is a prometheus exporter for directory sizes
{ lib
, rustPlatform
, fetchFromGitHub
, stdenv
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "prometheus-folder-size-exporter";
version = "0.5.0";
src = fetchFromGitHub {
owner = "MindFlavor";
repo = "prometheus_folder_size_exporter";
rev = version;
hash = "sha256-G1oWGiTyftloPxgOuiYFO7hofHdbwPCG4QDXK1t5qWk=";
};
postPatch = ''
# patch to use gauge instead of counter
# from https://github.com/MindFlavor/prometheus_folder_size_exporter/pull/18/files
sed -i -E 's/(MetricType::)Counter/\1Gauge/g' ./src/main.rs
'';
cargoHash = "sha256-M9kvf0XNDtBzvCHVDs+JPC+oNTsWuDFKdjqVgNUnRLg=";
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
meta = with lib; {
description = "A Rust only folder size exporter for Prometheus (Grafana";
homepage = "https://github.com/MindFlavor/prometheus_folder_size_exporter";
license = licenses.mit;
maintainers = with maintainers; [ jpetrucciani ];
mainProgram = "prometheus_folder_size_exporter";
};
}