2021-07-05 00:33:51 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
2016-06-05 13:33:36 +00:00
|
|
|
|
2021-07-05 00:33:51 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "mysqld_exporter";
|
2023-12-19 19:13:10 +00:00
|
|
|
version = "0.15.1";
|
2016-06-05 13:33:36 +00:00
|
|
|
|
2016-06-06 10:26:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "prometheus";
|
|
|
|
repo = "mysqld_exporter";
|
2023-04-10 16:30:11 +00:00
|
|
|
rev = "v${version}";
|
2023-12-19 19:13:10 +00:00
|
|
|
sha256 = "sha256-P7EoWa0BWuAr3sjtrUxzofwlklhRLpzwpGVe31hFo7Q=";
|
2016-06-05 13:33:36 +00:00
|
|
|
};
|
|
|
|
|
2023-12-19 19:13:10 +00:00
|
|
|
vendorHash = "sha256-GEL9sMwwdGqpklm4yKNqzSOM6I/JzZjg3+ZB2ix2M8w=";
|
2021-07-05 00:33:51 +00:00
|
|
|
|
2021-08-26 06:45:51 +00:00
|
|
|
ldflags = let t = "github.com/prometheus/common/version"; in [
|
|
|
|
"-s" "-w"
|
|
|
|
"-X ${t}.Version=${version}"
|
2023-04-10 16:30:11 +00:00
|
|
|
"-X ${t}.Revision=${src.rev}"
|
2021-08-26 06:45:51 +00:00
|
|
|
"-X ${t}.Branch=unknown"
|
|
|
|
"-X ${t}.BuildUser=nix@nixpkgs"
|
|
|
|
"-X ${t}.BuildDate=unknown"
|
|
|
|
];
|
2021-07-26 12:19:57 +00:00
|
|
|
|
2021-07-05 00:33:51 +00:00
|
|
|
# skips tests with external dependencies, e.g. on mysqld
|
2022-05-20 23:57:16 +00:00
|
|
|
preCheck = ''
|
|
|
|
buildFlagsArray+="-short"
|
|
|
|
'';
|
2021-07-05 00:33:51 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-06-05 13:33:36 +00:00
|
|
|
description = "Prometheus exporter for MySQL server metrics";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/prometheus/mysqld_exporter";
|
2016-06-05 13:33:36 +00:00
|
|
|
license = licenses.asl20;
|
2019-08-20 17:36:05 +00:00
|
|
|
maintainers = with maintainers; [ benley globin ];
|
2016-06-05 13:33:36 +00:00
|
|
|
};
|
|
|
|
}
|