prometheus-systemd-exporter: Added ldflags to include version into

build_info metric.

Fixes: #256135
This commit is contained in:
Jonathan Davies 2023-09-19 22:01:10 +01:00 committed by Bjørn Forsman
parent ed5ab56d4c
commit 9958dbbd26

View File

@ -13,6 +13,16 @@ buildGoModule rec {
sha256 = "sha256-q6rnD8JCtB1zTkUfZt6f2Uyo91uFi3HYI7WFlZdzpBM=";
};
ldflags = [
"-s"
"-w"
"-X github.com/prometheus/common/version.Version=${version}"
"-X github.com/prometheus/common/version.Revision=unknown"
"-X github.com/prometheus/common/version.Branch=unknown"
"-X github.com/prometheus/common/version.BuildUser=nix@nixpkgs"
"-X github.com/prometheus/common/version.BuildDate=unknown"
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) systemd; };
meta = with lib; {