Watch
0
0
Fork
You've already forked hyperhive
0

matrix: report homeserver up, latency and database size through existing collectors

tuwunel 1.9.4 exports no metrics. The host collector gets an httpcheck
receiver on the gateway's /_matrix/client/versions (new
services.hyperhive.otel.httpChecks, declared by hive-matrix), and a timer in
the hive-matrix container pushes the database directory's size through the
forwarder's OTLP port, as the attic cache-size unit does. The size step
dereferences the state directory's symlink and pushes nothing for a result
under 4096 bytes.
This commit is contained in:
atlas 2026-11-05 01:24:22 +01:00 • committed by mara
commit bef9d401a4

View file

@ -189,6 +189,23 @@ in
'';
};
httpChecks = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = [ "https://chat.example/_matrix/client/versions" ];
description = ''
URLs this hive's collector requests every 60 s with the `httpcheck`
receiver, which reports whether each answered (`httpcheck.status`,
by status class), how long it took (`httpcheck.duration`) and
whether the request failed (`httpcheck.error`).
**A service adds its own URL, from its own module, under its own
`enable`.** The collector dials from the host, so the name has to
resolve there and its certificate has to chain to the trust bundle
this collector reads. Empty renders no receiver.
'';
};
journalUnits = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
@ -514,6 +531,15 @@ in
# validates and starts perfectly while reading nothing — and the
# empty set is the default, so that inert shape would be what
# most hives deploy.
// lib.optionalAttrs (otel.httpChecks != [ ]) {
httpcheck = {
collection_interval = "60s";
targets = map (endpoint: {
inherit endpoint;
method = "GET";
}) otel.httpChecks;
};
}
// lib.optionalAttrs (otel.scrapeTargets != { }) {
prometheus.config.scrape_configs = lib.mapAttrsToList (job: target: {
job_name = job;
@ -638,6 +664,7 @@ in
"hostmetrics"
]
++ lib.optional (otel.scrapeTargets != { }) "prometheus"
++ lib.optional (otel.httpChecks != [ ]) "httpcheck"
++ lib.optional gatewayCfg.enable "nginx";
# Applies to EVERY receiver above, not just `hostmetrics` — a
# processor sits in the pipeline, not on a receiver. That is