2021-05-16 13:38:04 +02:00
|
|
|
{ buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
2022-01-27 14:11:34 +01:00
|
|
|
, writeScript
|
2021-05-16 13:38:04 +02:00
|
|
|
}:
|
|
|
|
|
2022-01-27 14:11:34 +01: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-16 13:38:04 +02:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "opentelemetry-collector";
|
2022-05-17 14:35:20 +02:00
|
|
|
version = "0.51.0";
|
2021-05-16 13:38:04 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "open-telemetry";
|
2022-01-27 14:11:34 +01:00
|
|
|
repo = "opentelemetry-collector";
|
2021-05-16 13:38:04 +02:00
|
|
|
rev = "v${version}";
|
2022-05-17 14:35:20 +02:00
|
|
|
sha256 = "sha256-XCOyvFWvgGxjuOdyFk4Rh+HO8GBdRfWcR73h+7lF+8E=";
|
2021-05-16 13:38:04 +02:00
|
|
|
};
|
2022-01-27 14:11:34 +01:00
|
|
|
# there is a nested go.mod
|
|
|
|
sourceRoot = "source/cmd/otelcorecol";
|
2022-05-17 14:35:20 +02:00
|
|
|
vendorSha256 = "sha256-BAcJpiO6jFKcjtbBA9LDad1ifDpb47nWOylH8dDBUN0=";
|
2021-05-16 13:38:04 +02:00
|
|
|
|
2022-01-27 14:11:34 +01: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-16 13:38:04 +02:00
|
|
|
|
2022-01-27 14:11:34 +01:00
|
|
|
ldflags = [ "-s" "-w" ];
|
2021-11-10 00:43:11 +01:00
|
|
|
|
2022-01-27 14:11:34 +01:00
|
|
|
postInstall = ''
|
|
|
|
cp ${otelcontribcol} $out/bin/otelcontribcol
|
|
|
|
'';
|
2021-05-16 13:38:04 +02:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/open-telemetry/opentelemetry-collector";
|
2022-01-27 14:11:34 +01: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-16 13:38:04 +02:00
|
|
|
license = licenses.asl20;
|
2022-01-27 14:11:34 +01:00
|
|
|
maintainers = with maintainers; [ uri-canva jk ];
|
2021-05-16 13:38:04 +02:00
|
|
|
};
|
|
|
|
}
|