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-04-12 12:48:02 +00:00
|
|
|
version = "0.74.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-04-12 12:48:02 +00:00
|
|
|
sha256 = "sha256-A2xiYCU2Lq/F59pQhgQD8sf1BcRvuaWKvGdxNGQ938E=";
|
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-04-12 12:48:02 +00:00
|
|
|
vendorHash = "sha256-VTPywVGs56lJxYLwmz71jBJ5ltxCZYUw0z6RslN2ZOE=";
|
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
|
|
|
};
|
|
|
|
}
|