nixos/tests/prometheus-exporters: add graphite
This commit is contained in:
parent
dff2e184f4
commit
4ff3a5795b
2 changed files with 25 additions and 0 deletions
|
@ -284,6 +284,29 @@ let
|
|||
'';
|
||||
};
|
||||
|
||||
graphite = {
|
||||
exporterConfig = {
|
||||
enable = true;
|
||||
port = 9108;
|
||||
graphitePort = 9109;
|
||||
mappingSettings.mappings = [{
|
||||
match = "test.*.*";
|
||||
name = "testing";
|
||||
labels = {
|
||||
protocol = "$1";
|
||||
author = "$2";
|
||||
};
|
||||
}];
|
||||
};
|
||||
exporterTest = ''
|
||||
wait_for_unit("prometheus-graphite-exporter.service")
|
||||
wait_for_open_port(9108)
|
||||
wait_for_open_port(9109)
|
||||
succeed("echo test.tcp.foo-bar 1234 $(date +%s) | nc -w1 localhost 9109")
|
||||
succeed("curl -sSf http://localhost:9108/metrics | grep 'testing{author=\"foo-bar\",protocol=\"tcp\"} 1234'")
|
||||
'';
|
||||
};
|
||||
|
||||
influxdb = {
|
||||
exporterConfig = {
|
||||
enable = true;
|
||||
|
|
|
@ -25,6 +25,8 @@ buildGoModule rec {
|
|||
buildFlagsArray+=("-run" "[^(${builtins.concatStringsSep "|" skippedTests})]")
|
||||
'';
|
||||
|
||||
passthru.tests = { inherit (nixosTests.prometheus-exporters) graphite; };
|
||||
|
||||
meta = {
|
||||
description = "An exporter for metrics exported in the Graphite plaintext protocol";
|
||||
homepage = "https://github.com/prometheus/graphite_exporter";
|
||||
|
|
Loading…
Reference in a new issue