From aa20ba5563ee1a731969c553ee3b255b5548de98 Mon Sep 17 00:00:00 2001 From: Armeen Mahdian Date: Tue, 26 Apr 2022 08:43:24 -0500 Subject: [PATCH] dd-agent: remove --- .../from_md/release-notes/rl-2211.section.xml | 9 + .../manual/release-notes/rl-2211.section.md | 2 + nixos/modules/module-list.nix | 1 - nixos/modules/rename.nix | 1 + .../monitoring/dd-agent/dd-agent-defaults.nix | 8 - .../services/monitoring/dd-agent/dd-agent.nix | 236 ------------------ .../dd-agent/update-dd-agent-defaults | 9 - .../dd-agent/40103-iostat-fix.patch | 30 --- pkgs/tools/networking/dd-agent/5.nix | 108 -------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 1 - 11 files changed, 13 insertions(+), 393 deletions(-) delete mode 100644 nixos/modules/services/monitoring/dd-agent/dd-agent-defaults.nix delete mode 100644 nixos/modules/services/monitoring/dd-agent/dd-agent.nix delete mode 100755 nixos/modules/services/monitoring/dd-agent/update-dd-agent-defaults delete mode 100644 pkgs/tools/networking/dd-agent/40103-iostat-fix.patch delete mode 100644 pkgs/tools/networking/dd-agent/5.nix diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml index 9b08a5444594..556a4b9d9cec 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml @@ -441,6 +441,15 @@ available via the hardware.xone module. + + + dd-agent package removed along with the + services.dd-agent module, due to the + project being deprecated in favor of + datadog-agent, which is available via the + services.datadog-agent module. + + virtlyst package and services.virtlyst diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md index 584a17cfca2c..5a8c4cd82db6 100644 --- a/nixos/doc/manual/release-notes/rl-2211.section.md +++ b/nixos/doc/manual/release-notes/rl-2211.section.md @@ -154,6 +154,8 @@ Available as [services.patroni](options.html#opt-services.patroni.enable). - xow package removed along with the `hardware.xow` module, due to the project being deprecated in favor of `xone`, which is available via the `hardware.xone` module. +- dd-agent package removed along with the `services.dd-agent` module, due to the project being deprecated in favor of `datadog-agent`, which is available via the `services.datadog-agent` module. + - virtlyst package and `services.virtlyst` module removed, due to lack of maintainers. - The `services.graphite.api` and `services.graphite.beacon` NixOS options, and diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 12692d7bfbe6..006a1a3fde43 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -668,7 +668,6 @@ ./services/monitoring/collectd.nix ./services/monitoring/das_watchdog.nix ./services/monitoring/datadog-agent.nix - ./services/monitoring/dd-agent/dd-agent.nix ./services/monitoring/do-agent.nix ./services/monitoring/fusion-inventory.nix ./services/monitoring/grafana.nix diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index f86aa2fa5c1b..aef42d0f4db1 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -48,6 +48,7 @@ with lib; (mkRemovedOptionModule [ "services" "cgmanager" "enable"] "cgmanager was deprecated by lxc and therefore removed from nixpkgs.") (mkRemovedOptionModule [ "services" "chronos" ] "The corresponding package was removed from nixpkgs.") (mkRemovedOptionModule [ "services" "couchpotato" ] "The corresponding package was removed from nixpkgs.") + (mkRemovedOptionModule [ "services" "dd-agent" ] "dd-agent was removed from nixpkgs in favor of the newer datadog-agent.") (mkRemovedOptionModule [ "services" "deepin" ] "The corresponding packages were removed from nixpkgs.") (mkRemovedOptionModule [ "services" "dnscrypt-proxy" ] "Use services.dnscrypt-proxy2 instead") (mkRemovedOptionModule [ "services" "firefox" "syncserver" ] "The corresponding package was removed from nixpkgs.") diff --git a/nixos/modules/services/monitoring/dd-agent/dd-agent-defaults.nix b/nixos/modules/services/monitoring/dd-agent/dd-agent-defaults.nix deleted file mode 100644 index 045128197421..000000000000 --- a/nixos/modules/services/monitoring/dd-agent/dd-agent-defaults.nix +++ /dev/null @@ -1,8 +0,0 @@ -# Generated using update-dd-agent-default, please re-run after updating dd-agent. DO NOT EDIT MANUALLY. -[ - "auto_conf" - "agent_metrics.yaml.default" - "disk.yaml.default" - "network.yaml.default" - "ntp.yaml.default" -] diff --git a/nixos/modules/services/monitoring/dd-agent/dd-agent.nix b/nixos/modules/services/monitoring/dd-agent/dd-agent.nix deleted file mode 100644 index 8c0070c4853a..000000000000 --- a/nixos/modules/services/monitoring/dd-agent/dd-agent.nix +++ /dev/null @@ -1,236 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - cfg = config.services.dd-agent; - - ddConf = pkgs.writeText "datadog.conf" '' - [Main] - dd_url: https://app.datadoghq.com - skip_ssl_validation: no - api_key: ${cfg.api_key} - ${optionalString (cfg.hostname != null) "hostname: ${cfg.hostname}"} - - collector_log_file: /var/log/datadog/collector.log - forwarder_log_file: /var/log/datadog/forwarder.log - dogstatsd_log_file: /var/log/datadog/dogstatsd.log - pup_log_file: /var/log/datadog/pup.log - - # proxy_host: my-proxy.com - # proxy_port: 3128 - # proxy_user: user - # proxy_password: password - - # tags: mytag0, mytag1 - ${optionalString (cfg.tags != null ) "tags: ${concatStringsSep ", " cfg.tags }"} - - # collect_ec2_tags: no - # recent_point_threshold: 30 - # use_mount: no - # listen_port: 17123 - # graphite_listen_port: 17124 - # non_local_traffic: no - # use_curl_http_client: False - # bind_host: localhost - - # use_pup: no - # pup_port: 17125 - # pup_interface: localhost - # pup_url: http://localhost:17125 - - # dogstatsd_port : 8125 - # dogstatsd_interval : 10 - # dogstatsd_normalize : yes - # statsd_forward_host: address_of_own_statsd_server - # statsd_forward_port: 8125 - - # device_blacklist_re: .*\/dev\/mapper\/lxc-box.* - - # ganglia_host: localhost - # ganglia_port: 8651 - ''; - - diskConfig = pkgs.writeText "disk.yaml" '' - init_config: - - instances: - - use_mount: no - ''; - - networkConfig = pkgs.writeText "network.yaml" '' - init_config: - - instances: - # Network check only supports one configured instance - - collect_connection_state: false - excluded_interfaces: - - lo - - lo0 - ''; - - postgresqlConfig = pkgs.writeText "postgres.yaml" cfg.postgresqlConfig; - nginxConfig = pkgs.writeText "nginx.yaml" cfg.nginxConfig; - mongoConfig = pkgs.writeText "mongo.yaml" cfg.mongoConfig; - jmxConfig = pkgs.writeText "jmx.yaml" cfg.jmxConfig; - processConfig = pkgs.writeText "process.yaml" cfg.processConfig; - - etcfiles = - let - defaultConfd = import ./dd-agent-defaults.nix; - in - listToAttrs (map (f: { - name = "dd-agent/conf.d/${f}"; - value.source = "${pkgs.dd-agent}/agent/conf.d-system/${f}"; - }) defaultConfd) // - { - "dd-agent/datadog.conf".source = ddConf; - "dd-agent/conf.d/disk.yaml".source = diskConfig; - "dd-agent/conf.d/network.yaml".source = networkConfig; - } // - (optionalAttrs (cfg.postgresqlConfig != null) - { - "dd-agent/conf.d/postgres.yaml".source = postgresqlConfig; - }) // - (optionalAttrs (cfg.nginxConfig != null) - { - "dd-agent/conf.d/nginx.yaml".source = nginxConfig; - }) // - (optionalAttrs (cfg.mongoConfig != null) - { - "dd-agent/conf.d/mongo.yaml".source = mongoConfig; - }) // - (optionalAttrs (cfg.processConfig != null) - { - "dd-agent/conf.d/process.yaml".source = processConfig; - }) // - (optionalAttrs (cfg.jmxConfig != null) - { - "dd-agent/conf.d/jmx.yaml".source = jmxConfig; - }); - -in { - options.services.dd-agent = { - enable = mkOption { - description = lib.mdDoc '' - Whether to enable the dd-agent v5 monitoring service. - For datadog-agent v6, see {option}`services.datadog-agent.enable`. - ''; - default = false; - type = types.bool; - }; - - api_key = mkOption { - description = lib.mdDoc '' - The Datadog API key to associate the agent with your account. - - Warning: this key is stored in cleartext within the world-readable - Nix store! Consider using the new v6 - {option}`services.datadog-agent` module instead. - ''; - example = "ae0aa6a8f08efa988ba0a17578f009ab"; - type = types.str; - }; - - tags = mkOption { - description = lib.mdDoc "The tags to mark this Datadog agent"; - example = [ "test" "service" ]; - default = null; - type = types.nullOr (types.listOf types.str); - }; - - hostname = mkOption { - description = lib.mdDoc "The hostname to show in the Datadog dashboard (optional)"; - default = null; - example = "mymachine.mydomain"; - type = types.nullOr types.str; - }; - - postgresqlConfig = mkOption { - description = lib.mdDoc "Datadog PostgreSQL integration configuration"; - default = null; - type = types.nullOr types.lines; - }; - - nginxConfig = mkOption { - description = lib.mdDoc "Datadog nginx integration configuration"; - default = null; - type = types.nullOr types.lines; - }; - - mongoConfig = mkOption { - description = lib.mdDoc "MongoDB integration configuration"; - default = null; - type = types.nullOr types.lines; - }; - - jmxConfig = mkOption { - description = lib.mdDoc "JMX integration configuration"; - default = null; - type = types.nullOr types.lines; - }; - - processConfig = mkOption { - description = lib.mdDoc '' - Process integration configuration - See - ''; - default = null; - type = types.nullOr types.lines; - }; - - }; - - config = mkIf cfg.enable { - environment.systemPackages = [ pkgs.dd-agent pkgs.sysstat pkgs.procps ]; - - users.users.datadog = { - description = "Datadog Agent User"; - uid = config.ids.uids.datadog; - group = "datadog"; - home = "/var/log/datadog/"; - createHome = true; - }; - - users.groups.datadog.gid = config.ids.gids.datadog; - - systemd.services = let - makeService = attrs: recursiveUpdate { - path = [ pkgs.dd-agent pkgs.python pkgs.sysstat pkgs.procps pkgs.gohai ]; - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - User = "datadog"; - Group = "datadog"; - Restart = "always"; - RestartSec = 2; - PrivateTmp = true; - }; - restartTriggers = [ pkgs.dd-agent ddConf diskConfig networkConfig postgresqlConfig nginxConfig mongoConfig jmxConfig processConfig ]; - } attrs; - in { - dd-agent = makeService { - description = "Datadog agent monitor"; - serviceConfig.ExecStart = "${pkgs.dd-agent}/bin/dd-agent foreground"; - }; - - dogstatsd = makeService { - description = "Datadog statsd"; - environment.TMPDIR = "/run/dogstatsd"; - serviceConfig = { - ExecStart = "${pkgs.dd-agent}/bin/dogstatsd start"; - Type = "forking"; - PIDFile = "/run/dogstatsd/dogstatsd.pid"; - RuntimeDirectory = "dogstatsd"; - }; - }; - - dd-jmxfetch = lib.mkIf (cfg.jmxConfig != null) { - description = "Datadog JMX Fetcher"; - path = [ pkgs.dd-agent pkgs.python pkgs.sysstat pkgs.procps pkgs.jdk ]; - serviceConfig.ExecStart = "${pkgs.dd-agent}/bin/dd-jmxfetch"; - }; - }; - - environment.etc = etcfiles; - }; -} diff --git a/nixos/modules/services/monitoring/dd-agent/update-dd-agent-defaults b/nixos/modules/services/monitoring/dd-agent/update-dd-agent-defaults deleted file mode 100755 index 76724173171a..000000000000 --- a/nixos/modules/services/monitoring/dd-agent/update-dd-agent-defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -dd=$(nix-build --no-out-link -A dd-agent ../../../..) -echo '# Generated using update-dd-agent-default, please re-run after updating dd-agent. DO NOT EDIT MANUALLY.' > dd-agent-defaults.nix -echo '[' >> dd-agent-defaults.nix -echo ' "auto_conf"' >> dd-agent-defaults.nix -for f in $(find $dd/agent/conf.d-system -maxdepth 1 -type f | grep -v '\.example' | sort); do - echo " \"$(basename $f)\"" >> dd-agent-defaults.nix -done -echo ']' >> dd-agent-defaults.nix diff --git a/pkgs/tools/networking/dd-agent/40103-iostat-fix.patch b/pkgs/tools/networking/dd-agent/40103-iostat-fix.patch deleted file mode 100644 index 9897a76c957d..000000000000 --- a/pkgs/tools/networking/dd-agent/40103-iostat-fix.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/checks/system/unix.py b/checks/system/unix.py -index c37af3c3..58c72626 100644 ---- a/checks/system/unix.py -+++ b/checks/system/unix.py -@@ -39,7 +39,7 @@ class IO(Check): - self.value_re = re.compile(r'\d+\.\d+') - - def _parse_linux2(self, output): -- recentStats = output.split('Device:')[2].split('\n') -+ recentStats = output.split('Device')[2].split('\n') - header = recentStats[0] - headerNames = re.findall(self.header_re, header) - device = None -@@ -123,14 +123,14 @@ class IO(Check): - - # Linux 2.6.32-343-ec2 (ip-10-35-95-10) 12/11/2012 _x86_64_ (2 CPU) - # -- # Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util -+ # Device rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util - # sda1 0.00 17.61 0.26 32.63 4.23 201.04 12.48 0.16 4.81 0.53 1.73 - # sdb 0.00 2.68 0.19 3.84 5.79 26.07 15.82 0.02 4.93 0.22 0.09 - # sdg 0.00 0.13 2.29 3.84 100.53 30.61 42.78 0.05 8.41 0.88 0.54 - # sdf 0.00 0.13 2.30 3.84 100.54 30.61 42.78 0.06 9.12 0.90 0.55 - # md0 0.00 0.00 0.05 3.37 1.41 30.01 18.35 0.00 0.00 0.00 0.00 - # -- # Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util -+ # Device rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util - # sda1 0.00 0.00 0.00 10.89 0.00 43.56 8.00 0.03 2.73 2.73 2.97 - # sdb 0.00 0.00 0.00 2.97 0.00 11.88 8.00 0.00 0.00 0.00 0.00 - # sdg 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 diff --git a/pkgs/tools/networking/dd-agent/5.nix b/pkgs/tools/networking/dd-agent/5.nix deleted file mode 100644 index 6feaec38f70a..000000000000 --- a/pkgs/tools/networking/dd-agent/5.nix +++ /dev/null @@ -1,108 +0,0 @@ -{ lib, stdenv, fetchFromGitHub, python2 -, unzip, makeWrapper }: -let - python' = python2.override { - packageOverrides = self: super: { - docker = self.buildPythonPackage rec { - name = "docker-${version}"; - version = "1.10.6"; - - src = fetchFromGitHub { - owner = "docker"; - repo = "docker-py"; - rev = version; - sha256 = "1awzpbrkh4fympqzddz5i3ml81b7f0i0nwkvbpmyxjjfqx6l0m4m"; - }; - - propagatedBuildInputs = with self; [ - six - requests - websocket-client - docker_pycreds - uptime - ] ++ lib.optionals (self.pythonOlder "3.7") [ backports_ssl_match_hostname ]; - - # due to flake8 - doCheck = false; - }; - - pymongo = super.pymongo.overridePythonAttrs (oldAttrs: rec { - version = "2.9.5"; - src = oldAttrs.src.override { - inherit version; - sha256 = "912516ac6a355d7624374a38337b8587afe3eb535c0a5456b3bd12df637a6e70"; - }; - }); - }; - }; - -in stdenv.mkDerivation rec { - version = "5.11.2"; - pname = "dd-agent"; - - src = fetchFromGitHub { - owner = "datadog"; - repo = "dd-agent"; - rev = version; - sha256 = "1iqxvgpsqibqw3vk79158l2pnb6y4pjhjp2d6724lm5rpz4825lx"; - }; - - patches = [ ./40103-iostat-fix.patch ]; - - nativeBuildInputs = [ unzip makeWrapper ]; - buildInputs = with python'.pkgs; [ - requests - psycopg2 - psutil - ntplib - simplejson - pyyaml - pymongo - python-etcd - consul - docker - ]; - propagatedBuildInputs = with python'.pkgs; [ python tornado ]; - - buildCommand = '' - mkdir -p $out/bin - cp -R $src $out/agent - chmod u+w -R $out - (cd $out/agent; patchPhase) - PYTHONPATH=$out/agent:$PYTHONPATH - ln -s $out/agent/agent.py $out/bin/dd-agent - ln -s $out/agent/dogstatsd.py $out/bin/dogstatsd - ln -s $out/agent/ddagent.py $out/bin/dd-forwarder - - # Move out default conf.d so that /etc/dd-agent/conf.d is used - mv $out/agent/conf.d $out/agent/conf.d-system - - cat > $out/bin/dd-jmxfetch <