1{ pkgs, ... }:
2{
3 name = "trickster";
4 meta = with pkgs.lib; {
5 maintainers = with maintainers; [ _1000101 ];
6 };
7
8 nodes = {
9 prometheus =
10 { ... }:
11 {
12 services.prometheus.enable = true;
13 networking.firewall.allowedTCPPorts = [ 9090 ];
14 };
15 trickster =
16 { ... }:
17 {
18 services.trickster.enable = true;
19 };
20 };
21
22 testScript = ''
23 start_all()
24 prometheus.wait_for_unit("prometheus.service")
25 prometheus.wait_for_open_port(9090)
26 prometheus.wait_until_succeeds(
27 "curl -fL http://localhost:9090/metrics | grep 'promhttp_metric_handler_requests_total{code=\"500\"} 0'"
28 )
29 trickster.wait_for_unit("trickster.service")
30 trickster.wait_for_open_port(8082)
31 trickster.wait_for_open_port(9090)
32 trickster.wait_until_succeeds(
33 "curl -fL http://localhost:8082/metrics | grep 'promhttp_metric_handler_requests_total{code=\"500\"} 0'"
34 )
35 trickster.wait_until_succeeds(
36 "curl -fL http://prometheus:9090/metrics | grep 'promhttp_metric_handler_requests_total{code=\"500\"} 0'"
37 )
38 trickster.wait_until_succeeds(
39 "curl -fL http://localhost:9090/metrics | grep 'promhttp_metric_handler_requests_total{code=\"500\"} 0'"
40 )
41 '';
42}