2021-05-28 09:39:13 +00:00
|
|
|
{ buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
2022-02-10 20:34:41 +00:00
|
|
|
, writeScript
|
2021-05-28 09:39:13 +00:00
|
|
|
}:
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
let
|
|
|
|
otelcontribcol = writeScript "otelcontribcol" ''
|
|
|
|
echo 'ERROR: otelcontribcol is now in `pkgs.opentelemetry-collector-contrib`, call the collector with `otelcorecol` or move to `pkgs.opentelemetry-collector-contrib`' >&2
|
|
|
|
exit 1
|
|
|
|
'';
|
|
|
|
in
|
2021-05-28 09:39:13 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "opentelemetry-collector";
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "0.62.1";
|
2021-05-28 09:39:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "open-telemetry";
|
2022-02-10 20:34:41 +00:00
|
|
|
repo = "opentelemetry-collector";
|
2021-05-28 09:39:13 +00:00
|
|
|
rev = "v${version}";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-X0ltNJQEmw7Ifp1DB4Gp1PkdR1tdPzDU4skfxp5Q3ak=";
|
2021-05-28 09:39:13 +00:00
|
|
|
};
|
2022-02-10 20:34:41 +00:00
|
|
|
# there is a nested go.mod
|
|
|
|
sourceRoot = "source/cmd/otelcorecol";
|
2022-10-21 18:38:19 +00:00
|
|
|
vendorSha256 = "sha256-E/OB4n3R8B8pOpPVmGU4nzBRIeweNboTq6TBjfCgGQQ=";
|
2021-05-28 09:39:13 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
preBuild = ''
|
|
|
|
# set the build version, can't be done via ldflags
|
|
|
|
sed -i -E 's/Version:(\s*)".*"/Version:\1"${version}"/' main.go
|
|
|
|
'';
|
2021-05-28 09:39:13 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
ldflags = [ "-s" "-w" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
postInstall = ''
|
|
|
|
cp ${otelcontribcol} $out/bin/otelcontribcol
|
|
|
|
'';
|
2021-05-28 09:39:13 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/open-telemetry/opentelemetry-collector";
|
2022-02-10 20:34:41 +00:00
|
|
|
changelog = "https://github.com/open-telemetry/opentelemetry-collector/blob/v${version}/CHANGELOG.md";
|
|
|
|
description = "OpenTelemetry Collector offers a vendor-agnostic implementation on how to receive, process and export telemetry data";
|
|
|
|
longDescription = ''
|
|
|
|
The OpenTelemetry Collector offers a vendor-agnostic implementation on how
|
|
|
|
to receive, process and export telemetry data. In addition, it removes the
|
|
|
|
need to run, operate and maintain multiple agents/collectors in order to
|
|
|
|
support open-source telemetry data formats (e.g. Jaeger, Prometheus, etc.)
|
|
|
|
sending to multiple open-source or commercial back-ends.
|
|
|
|
'';
|
2021-05-28 09:39:13 +00:00
|
|
|
license = licenses.asl20;
|
2022-02-10 20:34:41 +00:00
|
|
|
maintainers = with maintainers; [ uri-canva jk ];
|
2021-05-28 09:39:13 +00:00
|
|
|
};
|
|
|
|
}
|