mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(monitoring): customize metrics ingest path
This commit is contained in:
parent
f271f1ae00
commit
f97ab24f47
2 changed files with 12 additions and 4 deletions
|
|
@ -5,8 +5,8 @@
|
|||
...
|
||||
}: let
|
||||
inherit (gensokyo-zone) systems;
|
||||
inherit (gensokyo-zone.lib) mkAddress6;
|
||||
inherit (lib.modules) mkDefault;
|
||||
inherit (gensokyo-zone.lib) mkAddress6 mapOptionDefaults;
|
||||
inherit (lib.modules) mkIf mkMerge mkDefault mkOptionDefault;
|
||||
inherit (lib.attrsets) attrValues;
|
||||
inherit (lib.lists) filter concatMap;
|
||||
nodeExporterSystems =
|
||||
|
|
@ -35,7 +35,12 @@
|
|||
static_configs = [
|
||||
{
|
||||
inherit targets;
|
||||
labels = mkDefault service.prometheus.exporter.labels;
|
||||
labels = mkMerge [
|
||||
(mapOptionDefaults service.prometheus.exporter.labels)
|
||||
(mkIf (service.prometheus.exporter.metricsPath != "/metrics") {
|
||||
__metrics_path__ = mkOptionDefault service.prometheus.exporter.metricsPath;
|
||||
})
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -28,6 +28,10 @@ let
|
|||
labels = mkOption {
|
||||
type = attrsOf str;
|
||||
};
|
||||
metricsPath = mkOption {
|
||||
type = str;
|
||||
default = "/metrics";
|
||||
};
|
||||
};
|
||||
};
|
||||
ports = mkOption {
|
||||
|
|
@ -183,7 +187,6 @@ in
|
|||
};
|
||||
};
|
||||
promtail = {config, ...}: {
|
||||
id = mkAlmostOptionDefault "promtail";
|
||||
nixos = {
|
||||
serviceAttr = "promtail";
|
||||
assertions = mkIf config.enable [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue