2024-03-21 05:26:03 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
options,
|
|
|
|
...
|
|
|
|
}:
|
2021-03-12 11:11:16 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.prometheus.exporters.jitsi;
|
2024-04-24 14:41:17 -04:00
|
|
|
inherit (lib)
|
|
|
|
mkOption
|
|
|
|
types
|
|
|
|
escapeShellArg
|
|
|
|
concatStringsSep
|
|
|
|
;
|
2021-03-12 11:11:16 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
port = 9700;
|
|
|
|
extraOpts = {
|
|
|
|
url = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "http://localhost:8080/colibri/stats";
|
|
|
|
description = ''
|
|
|
|
Jitsi Videobridge metrics URL to monitor.
|
|
|
|
This is usually /colibri/stats on port 8080 of the jitsi videobridge host.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
interval = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "30s";
|
|
|
|
example = "1min";
|
|
|
|
description = ''
|
|
|
|
How often to scrape new data
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
serviceOpts = {
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = ''
|
|
|
|
${pkgs.prometheus-jitsi-exporter}/bin/jitsiexporter \
|
|
|
|
-url ${escapeShellArg cfg.url} \
|
|
|
|
-host ${cfg.listenAddress} \
|
|
|
|
-port ${toString cfg.port} \
|
|
|
|
-interval ${toString cfg.interval} \
|
|
|
|
${concatStringsSep " \\\n " cfg.extraFlags}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|