Skip to content

Commit 39c528f

Browse files
authored
datadog-agent: 7.50.3 -> 7.56.2 (NixOS#358927)
2 parents b722c71 + b6788a4 commit 39c528f

File tree

4 files changed

+41
-39
lines changed

4 files changed

+41
-39
lines changed

nixos/modules/services/monitoring/datadog-agent.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ let
1313
// lib.optionalAttrs (cfg.ddUrl != null) { dd_url = cfg.ddUrl; }
1414
// lib.optionalAttrs (cfg.site != null) { site = cfg.site; }
1515
// lib.optionalAttrs (cfg.tags != null ) { tags = lib.concatStringsSep ", " cfg.tags; }
16-
// lib.optionalAttrs (cfg.enableLiveProcessCollection) { process_config = { enabled = "true"; }; }
16+
// lib.optionalAttrs (cfg.enableLiveProcessCollection) {
17+
process_config = {
18+
dd_agent_bin = "${datadogPkg}/bin/agent";
19+
process_collection.enabled = "true";
20+
container_collection.enabled = "true";
21+
};
22+
}
1723
// lib.optionalAttrs (cfg.enableTraceAgent) { apm_config = { enabled = true; }; }
1824
// cfg.extraConfig;
1925

pkgs/tools/networking/dd-agent/datadog-agent.nix

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
11
{ lib
22
, stdenv
33
, cmake
4-
, buildGoModule
4+
, buildGo122Module
55
, makeWrapper
66
, fetchFromGitHub
77
, pythonPackages
88
, pkg-config
99
, systemd
1010
, hostname
1111
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
12+
, withDocker ? true
1213
, extraTags ? [ ]
1314
, testers
1415
, datadog-agent
1516
}:
1617

1718
let
1819
# keep this in sync with github.com/DataDog/agent-payload dependency
19-
payloadVersion = "5.0.97";
20+
payloadVersion = "5.0.124";
2021
python = pythonPackages.python;
2122
owner = "DataDog";
2223
repo = "datadog-agent";
2324
goPackagePath = "github.com/${owner}/${repo}";
24-
version = "7.50.3";
25+
version = "7.56.2";
2526

2627
src = fetchFromGitHub {
2728
inherit owner repo;
2829
rev = version;
29-
hash = "sha256-AN5BruLPyrpIGSUkcYkZC0VgItk9NHiZTXstv6j9TlY=";
30+
hash = "sha256-rU3eg92MuGs/6r7oJho2roeUCZoyfqYt1xOERoRPqmQ=";
3031
};
3132
rtloader = stdenv.mkDerivation {
3233
pname = "datadog-agent-rtloader";
@@ -37,19 +38,20 @@ let
3738
cmakeFlags = ["-DBUILD_DEMO=OFF" "-DDISABLE_PYTHON2=ON"];
3839
};
3940

40-
in buildGoModule rec {
41+
in buildGo122Module rec {
4142
pname = "datadog-agent";
4243
inherit src version;
4344

4445
doCheck = false;
4546

46-
vendorHash = "sha256-Rn8EB/6FHQk9COlOaxm4TQXjGCIPZHJV2QQnPDcbRnM=";
47+
vendorHash = if stdenv.isDarwin
48+
then "sha256-3Piq5DPMTZUEjqNkw5HZY25An2kATX6Jac9unQfZnZc="
49+
else "sha256-FR0Et3DvjJhbYUPy9mpN0QCJ7QDU4VRZFUTL0J1FSXw=";
4750

4851
subPackages = [
4952
"cmd/agent"
5053
"cmd/cluster-agent"
5154
"cmd/dogstatsd"
52-
"cmd/py-launcher"
5355
"cmd/trace-agent"
5456
];
5557

@@ -67,26 +69,25 @@ in buildGoModule rec {
6769
"zlib"
6870
]
6971
++ lib.optionals withSystemd [ "systemd" ]
72+
++ lib.optionals withDocker [ "docker" ]
7073
++ extraTags;
7174

7275
ldflags = [
7376
"-X ${goPackagePath}/pkg/version.Commit=${src.rev}"
7477
"-X ${goPackagePath}/pkg/version.AgentVersion=${version}"
7578
"-X ${goPackagePath}/pkg/serializer.AgentPayloadVersion=${payloadVersion}"
7679
"-X ${goPackagePath}/pkg/collector/python.pythonHome3=${python}"
77-
"-X ${goPackagePath}/pkg/config.DefaultPython=3"
80+
"-X ${goPackagePath}/pkg/config/setup.DefaultPython=3"
7881
"-r ${python}/lib"
7982
];
8083

81-
preBuild = ''
82-
# Keep directories to generate in sync with tasks/go.py
83-
go generate ./pkg/status ./cmd/agent/gui
84-
'';
85-
8684
# DataDog use paths relative to the agent binary, so fix these.
85+
# We can't just point these to $out since that would introduce self-referential paths in the go modules,
86+
# which are a fixed-output derivation. However, the patches aren't picked up if we skip them when building
87+
# the modules. So we'll just traverse from the bin back to the out folder.
8788
postPatch = ''
88-
sed -e "s|PyChecksPath =.*|PyChecksPath = \"$out/${python.sitePackages}\"|" \
89-
-e "s|distPath =.*|distPath = \"$out/share/datadog-agent\"|" \
89+
sed -e "s|PyChecksPath =.*|PyChecksPath = filepath.Join(_here, \"..\", \"${python.sitePackages}\")|" \
90+
-e "s|distPath =.*|distPath = filepath.Join(_here, \"..\", \"share\", \"datadog-agent\")|" \
9091
-i cmd/agent/common/path/path_nix.go
9192
sed -e "s|/bin/hostname|${lib.getBin hostname}/bin/hostname|" \
9293
-i pkg/util/hostname/fqdn_nix.go
@@ -97,11 +98,9 @@ in buildGoModule rec {
9798
postInstall = ''
9899
mkdir -p $out/${python.sitePackages} $out/share/datadog-agent
99100
cp -R --no-preserve=mode $src/cmd/agent/dist/conf.d $out/share/datadog-agent
100-
rm -rf $out/share/datadog-agent/conf.d/{apm.yaml.default,process_agent.yaml.default,winproc.d}
101+
rm -rf $out/share/datadog-agent/conf.d/{apm.yaml.default,process_agent.yaml.default,winproc.d,agentcrashdetect.d,myapp.d}
101102
cp -R $src/cmd/agent/dist/{checks,utils,config.py} $out/${python.sitePackages}
102103
103-
cp -R $src/pkg/status/templates $out/share/datadog-agent
104-
105104
wrapProgram "$out/bin/agent" \
106105
--set PYTHONPATH "$out/${python.sitePackages}"''
107106
+ lib.optionalString withSystemd " --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ (lib.getLib systemd) rtloader ]}";
@@ -119,10 +118,5 @@ in buildGoModule rec {
119118
homepage = "https://www.datadoghq.com";
120119
license = licenses.bsd3;
121120
maintainers = with maintainers; [ thoughtpolice domenkozar ];
122-
# never built on aarch64-darwin since first introduction in nixpkgs
123-
# broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;
124-
125-
# Upstream does not support Go > 1.21; for update refer to https://github.com/NixOS/nixpkgs/issues/351119
126-
broken = true;
127121
};
128122
}

pkgs/tools/networking/dd-agent/integrations-core.nix

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,30 @@
3333
#
3434
# [1]: https://github.com/DataDog/integrations-core
3535

36-
{ pkgs, python, extraIntegrations ? {} }:
36+
{ lib, fetchFromGitHub, python3Packages, extraIntegrations ? { }, }:
3737

3838
let
39-
inherit (pkgs.lib) attrValues mapAttrs;
39+
inherit (lib) attrValues mapAttrs;
4040

41-
src = pkgs.fetchFromGitHub {
41+
src = fetchFromGitHub {
4242
owner = "DataDog";
4343
repo = "integrations-core";
4444
rev = version;
45-
sha256 = "sha256-CIzuJ97KwsG1k65Y+8IUSka/3JX1pmQKN3hPHzZnGhQ=";
45+
sha256 = "sha256-p5eoNNHQQl314mfUk2t3qQaerPu02GKA+tKkAY7bojk=";
4646
};
47-
version = "7.38.0";
47+
version = "7.56.2";
4848

4949
# Build helper to build a single datadog integration package.
50-
buildIntegration = { pname, ... }@args: python.pkgs.buildPythonPackage (args // {
51-
inherit src version;
52-
name = "datadog-integration-${pname}-${version}";
50+
buildIntegration = { pname, ... }@args:
51+
python3Packages.buildPythonPackage (args // {
52+
inherit src version;
53+
name = "datadog-integration-${pname}-${version}";
54+
pyproject = true;
5355

54-
sourceRoot = "${src.name}/${args.sourceRoot or pname}";
55-
doCheck = false;
56-
});
56+
sourceRoot = "${src.name}/${args.sourceRoot or pname}";
57+
buildInputs = with python3Packages; [ hatchling setuptools ];
58+
doCheck = false;
59+
});
5760

5861
# Base package depended on by all other integrations.
5962
datadog_checks_base = buildIntegration {
@@ -67,7 +70,7 @@ let
6770
--replace "packages=['datadog_checks']" "packages=find_packages()"
6871
'';
6972

70-
propagatedBuildInputs = with python.pkgs; [
73+
propagatedBuildInputs = with python3Packages; [
7174
binary
7275
cachetools
7376
cryptography
@@ -107,10 +110,10 @@ let
107110
integrations = defaultIntegrations // extraIntegrations;
108111
builtIntegrations = mapAttrs (pname: fdeps: buildIntegration {
109112
inherit pname;
110-
propagatedBuildInputs = (fdeps python.pkgs) ++ [ datadog_checks_base ];
113+
propagatedBuildInputs = (fdeps python3Packages) ++ [ datadog_checks_base ];
111114
}) integrations;
112115

113116
in builtIntegrations // {
114117
inherit datadog_checks_base;
115-
python = python.withPackages (_: (attrValues builtIntegrations));
118+
python = python3Packages.python.withPackages (_: (attrValues builtIntegrations));
116119
}

pkgs/top-level/all-packages.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13470,7 +13470,6 @@ with pkgs;
1347013470
};
1347113471
datadog-process-agent = callPackage ../tools/networking/dd-agent/datadog-process-agent.nix { };
1347213472
datadog-integrations-core = extras: callPackage ../tools/networking/dd-agent/integrations-core.nix {
13473-
python = python3;
1347413473
extraIntegrations = extras;
1347513474
};
1347613475

0 commit comments

Comments
 (0)