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";
|
2023-02-16 17:41:37 +00:00
|
|
|
version = "0.71.0";
|
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}";
|
2023-02-16 17:41:37 +00:00
|
|
|
sha256 = "sha256-Y6HSz81edWklXhTbaK9LvdwmgNPRMtI1BD0IfcjWl3I=";
|
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";
|
2023-02-16 17:41:37 +00:00
|
|
|
vendorHash = "sha256-Zi9Rkfm+y0jZySwMJxAa5Sx/r5WAYvOVez3J0yQza2w=";
|
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
|
|
|
};
|
|
|
|
}
|