Add stuff
Eelco Dolstra committed
Jul 25, 2014 at 15:22 UTC
fccf86e372a402b3e59178b972789deaf52dee2a
2 files changed
+33
delft/datadog/hydra.nix
new
+21
@@ -0,0 +1,21 @@
1
+{config, pkgs, ...}:
2
+{
3
+ systemd.services.dd-agent.environment.PYTHONPATH = "${pkgs.pythonPackages.requests}/lib/python2.7/site-packages";
4
+ environment.etc =
5
+ let
6
+ hydra-config =
7
+ pkgs.writeText "hydra.yaml" ''
8
+ init_config:
9
+
10
+ instances:
11
+ - check: 1
12
+ '';
13
+ in [
14
+ { source = hydra-config;
15
+ target = "dd-agent/conf.d/hydra.yaml";
16
+ }
17
+ { source = ./hydra.py;
18
+ target = "dd-agent/checks.d/hydra.py";
19
+ }
20
+ ];
21
+}
delft/datadog/hydra.py
new
+12
@@ -0,0 +1,12 @@
1
+#! /usr/bin/env python
2
+from checks import *
3
+import os
4
+import subprocess
5
+import requests
6
+import json
7
+
8
+class HydraCheck(AgentCheck):
9
+ def check(self, instance):
10
+ r = requests.get('http://localhost:3000/status', headers={'Content-Type':'application/json'})
11
+ self.gauge('hydra.active_buildsteps', len(json.loads(r.text)))
12
+