Skip to content

Commit

Permalink
datadog: Properly use configured package.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuuzetsu committed Jun 2, 2017
1 parent b829bdc commit 50f53da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions nixos/modules/services/monitoring/dd-agent/dd-agent.nix
Expand Up @@ -23,7 +23,7 @@ let
etcfiles =
map (i: { source = if builtins.hasAttr "config" i
then pkgs.writeText "${i.name}.yaml" i.config
else "${pkgs.dd-agent}/agent/conf.d-system/${i.name}.yaml";
else "${cfg.agent}/agent/conf.d-system/${i.name}.yaml";
target = "dd-agent/conf.d/${i.name}.yaml";
}
) cfg.integrations ++
Expand Down Expand Up @@ -119,21 +119,21 @@ in {
path = [ cfg.agent pkgs.python pkgs.sysstat pkgs.procps ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkgs.dd-agent}/bin/dd-agent foreground";
ExecStart = "${cfg.agent}/bin/dd-agent foreground";
User = "datadog";
Group = "datadog";
Restart = "always";
RestartSec = 2;
};
restartTriggers = [ pkgs.dd-agent ddConf ] ++ etcSources;
restartTriggers = [ cfg.agent ddConf ] ++ etcSources;
};

systemd.services.dd-jmxfetch = lib.mkIf (builtins.any (i: i.name == "jmx") cfg.integrations) {
description = "Datadog JMX Fetcher";
path = [ cfg.agent pkgs.python pkgs.sysstat pkgs.procps pkgs.jdk ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkgs.dd-agent}/bin/dd-jmxfetch";
ExecStart = "${cfg.agent}/bin/dd-jmxfetch";
User = "datadog";
Group = "datadog";
Restart = "always";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/networking/dd-agent/default.nix
Expand Up @@ -5,7 +5,7 @@
# wrapper with their PYTHONPATH. This means overrideAttrs is not
# strong enough (it overrides too late), we need to call it
# beforehand.
, extraBuildInputs ? [ pythonPackages.psutil ] }:

This comment has been minimized.

Copy link
@domenkozar

domenkozar Jun 2, 2017

Member

why did you remove psutil?

This comment has been minimized.

Copy link
@Fuuzetsu

Fuuzetsu Jun 2, 2017

Author Member

It was left here to begin with as a mistake from debugging. It's not a dependency of dd-agent itself at all, it's a dependency of some integrations that were previously default but no longer are: they were moved out of the repository.

With the new service, now you should pass psutil yourself like

      agent = pkgs.dd-agent.override {
        extraBuildInputs = [
          # disk, network
          pkgs.pythonPackages.psutil
          # ntp
          pkgs.pythonPackages.ntplib
        ];
      };

if you want those.

Notably in future I hope to get rid of extraBuildInputs and generate the right dependencies but that's a bit longer term than I could afford.

, extraBuildInputs ? [ ] }:
let
inherit (pythonPackages) python;
docker_1_10 = pythonPackages.buildPythonPackage rec {
Expand Down

0 comments on commit 50f53da

Please sign in to comment.