nixos: overhaul datadog module

This overhauls the Datadog module a bit to be much more useful. In
particular, it adds support for nginx and postgresql monitoring
integrations to dd-agent. These have to exist in separate files under
/etc/dd-agent, so the module just exposes then as separate options. In
the future, more integrations could be added this way.

In the process of doing this, I also had to rename the dd-agent user to
datadog. Note the UIDs did not change, so this is strictly backwards
compatible. The reason for this is to make it easier to create a
'datadog' postgres user with access to pg_stats, as 'dd-agent' typically
isn't a valid username. This allows the out of the box configurations to
be used.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
Austin Seipp
2014-05-02 00:43:27 -05:00
parent e67cc9ba07
commit 368a677c97
3 changed files with 98 additions and 35 deletions

View File

@@ -1,4 +1,5 @@
{ stdenv, fetchurl, python, sysstat, unzip, tornado, makeWrapper }:
{ stdenv, fetchurl, python, pythonPackages, sysstat, unzip, tornado
, makeWrapper }:
stdenv.mkDerivation rec {
version = "4.2.1";
@@ -9,7 +10,7 @@ stdenv.mkDerivation rec {
sha256 = "0s1lg7rqx86z0y111105gwkknzplq149cxd7v3yg30l22wn68dmv";
};
buildInputs = [ python unzip makeWrapper ];
buildInputs = [ python unzip makeWrapper pythonPackages.psycopg2 ];
propagatedBuildInputs = [ python tornado ];
postUnpack = "export sourceRoot=$sourceRoot/packaging";
@@ -21,18 +22,19 @@ stdenv.mkDerivation rec {
postInstall = ''
mv $out/usr/* $out
rmdir $out/usr
wrapProgram $out/bin/dd-forwarder --prefix PYTHONPATH : $PYTHONPATH
wrapProgram $out/bin/dd-forwarder \
--prefix PYTHONPATH : $PYTHONPATH
wrapProgram $out/bin/dd-agent \
--prefix PYTHONPATH : $PYTHONPATH
wrapProgram $out/bin/dogstatsd \
--prefix PYTHONPATH : $PYTHONPATH
'';
meta = {
description = "Event collector for the DataDog analysis service";
homepage = http://www.datadoghq.com;
maintainers = [ stdenv.lib.maintainers.iElectric ];
license = stdenv.lib.licenses.bsd3;
platforms = stdenv.lib.platforms.all;
homepage = http://www.datadoghq.com;
license = stdenv.lib.licenses.bsd3;
platforms = stdenv.lib.platforms.all;
maintainers = with stdenv.lib.maintainers; [ thoughtpolice iElectric ];
};
}