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";
|
2024-11-09 06:04:19 +00:00
|
|
|
version = "0.16.0";
|
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}";
|
2024-11-09 06:04:19 +00:00
|
|
|
sha256 = "sha256-2D868CSRoJjgDh0SkpDCTLTVbJ/0kWmLQJMyAKh6s/8=";
|
2016-06-05 13:33:36 +00:00
|
|
|
};
|
|
|
|
|
2024-11-09 06:04:19 +00:00
|
|
|
vendorHash = "sha256-9mrvqY0wtoMVAL0PEJ/NWtFzaQPcQDAJvYPluwd2Nx4=";
|
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
|
2024-01-07 10:10:58 +00:00
|
|
|
checkFlags = [
|
|
|
|
"-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";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "mysqld_exporter";
|
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
|
|
|
};
|
|
|
|
}
|