1 import ./make-test-python.nix ({ pkgs, ... }: {
5 environment.systemPackages = [ pkgs.jq ];
6 services.mimir.enable = true;
7 services.mimir.configuration = {
8 ingester.ring.replication_factor = 1;
11 services.telegraf.enable = true;
12 services.telegraf.extraConfig = {
13 agent.interval = "1s";
14 agent.flush_interval = "1s";
17 "${pkgs.coreutils}/bin/echo 'foo i=42i'"
19 data_format = "influx";
24 url = "http://localhost:8080/api/v1/push";
26 # Data format to output.
27 data_format = "prometheusremotewrite";
30 Content-Type = "application/x-protobuf";
31 Content-Encoding = "snappy";
32 X-Scope-OrgID = "nixos";
33 X-Prometheus-Remote-Write-Version = "0.1.0";
43 server.wait_for_unit("mimir.service")
44 server.wait_for_unit("telegraf.service")
45 server.wait_for_open_port(8080)
46 server.wait_until_succeeds(
47 "curl -H 'X-Scope-OrgID: nixos' http://127.0.0.1:8080/prometheus/api/v1/label/host/values | jq -r '.data[0]' | grep server"