Skip to content
Snippets Groups Projects
Commit 148dc2a7 authored by Tom Prince's avatar Tom Prince
Browse files

Expose zkap-spending-service metrics.

parent 5bafeb63
No related branches found
No related tags found
2 merge requests!228merge develop into production,!184Expose zkap-spending-service metrics.
......@@ -127,6 +127,16 @@ in
# Want a regex instead? try locations."~ /v\d+/"
proxyPass = "http://unix:${cfg.unixSocket}";
};
locations."/metrics" = {
proxyPass = "http://unix:${cfg.unixSocket}";
# Only allow our monitoringvpn subnet
extraConfig = ''
allow 172.23.23.0/24;
allow 127.0.0.1;
allow ::1;
deny all;
'';
};
locations."/" = {
# Return a 404 error for any paths not specified above.
extraConfig = ''
......
{
"owner": "privatestorage",
"repo": "zkap-spending-service",
"rev": "e0d63b79213d16f2de6629167ea8f1236ba22e14",
"rev": "cbf7509f429ffd6e6cf37a73e4ff84a9c5ce1141",
"branch": "main",
"domain": "whetstone.privatestorage.io",
"outputHash": "30abb0g9xxn4lp493kj5wmz8kj5q2iqvw40m8llqvb3zamx60gd8cy451ii7z15qbrbx9xmjdfw0k4gviij46fkx1s8nbich5c8qx57",
"outputHash": "04g7pcykc2525cg3z7wg5834s7vqn82xaqjvf52l6dnxv3mb9xr93kk505dvxcwhgfbqpim5i479s9kqd8gi7q3lq5wn5fq7rf7lkrj",
"outputHashAlgo": "sha512"
}
......@@ -28,5 +28,9 @@
with subtest("Ensure that the spending service version matches the expected version"):
output = spending.succeed("${curl} http://localhost/v1/_version")
assert json.loads(output)["revision"] == "${revision}", "Spending service revision does not match."
with subtest("Ensure that the spending service generates metrics"):
# TODO: We should pass "-H 'accept: application/openmetrics-text'" here.
# See https://github.com/prometheus/prometheus/issues/8932
output = spending.succeed("${curl} http://localhost/metrics | ${pkgs.prometheus}/bin/promtool check metrics")
'';
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment