add extra inputs option for the loki and mimir sinks

This commit is contained in:
goeranh 2026-04-20 13:52:57 +02:00
parent 93e27dd3e5
commit 53c592abd9
No known key found for this signature in database

View file

@ -16,6 +16,20 @@ in {
description = "Supplementary groups added to the vector systemd service to allow reading protected log files."; description = "Supplementary groups added to the vector systemd service to allow reading protected log files.";
example = [ "nginx" "postfix" ]; example = [ "nginx" "postfix" ];
}; };
extraMetricInputs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
description = "Additional vector component IDs to feed into the mimir sink alongside host_metrics.";
example = [ "proxmox_normalize_metrics" ];
};
extraLogInputs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
description = "Additional vector component IDs to feed into the loki sink alongside journald_logs.";
example = [ "proxmox_normalize_logs" ];
};
}; };
config = { config = {
@ -70,14 +84,15 @@ in {
sinks = { sinks = {
mimir = { mimir = {
type = "prometheus_remote_write"; type = "prometheus_remote_write";
inputs = [ "add_host_label_metrics" ]; inputs = [ "add_host_label_metrics" ] ++ cfg.extraMetricInputs;
endpoint = "https://met.adm.htw.stura-dresden.de/api/v1/push"; endpoint = "https://met.adm.htw.stura-dresden.de/api/v1/push";
tls.verify_certificate = false; tls.verify_certificate = false;
healthcheck.enabled = false;
}; };
loki = { loki = {
type = "loki"; type = "loki";
inputs = [ "add_host_label_logs" ]; inputs = [ "add_host_label_logs" ] ++ cfg.extraLogInputs;
endpoint = "https://log.adm.htw.stura-dresden.de"; endpoint = "https://log.adm.htw.stura-dresden.de";
labels = { labels = {
host = "{{ host }}"; host = "{{ host }}";