diff --git a/hosts/monitoring/default.nix b/hosts/monitoring/default.nix index 2438b1f..e0dbcaa 100644 --- a/hosts/monitoring/default.nix +++ b/hosts/monitoring/default.nix @@ -208,15 +208,28 @@ http.address = "0.0.0.0:4318"; }; - sinks.mimir.inputs = lib.mkForce [ - "add_host_label_metrics" - "proxmox_otlp.metrics" - ]; + transforms.proxmox_normalize_logs = { + type = "remap"; + inputs = [ "proxmox_otlp.logs" ]; + source = '' + .host = string(.resources."host.name") ?? "proxmox" + .unit = string(.attributes."service.name") ?? "proxmox" + ''; + }; - sinks.loki.inputs = lib.mkForce [ - "add_host_label_logs" - "proxmox_otlp.logs" - ]; + transforms.proxmox_normalize_metrics = { + type = "remap"; + inputs = [ "proxmox_otlp.metrics" ]; + source = '' + .tags.host = string(.resources."host.name") ?? "proxmox" + ''; + }; + + }; + + stura.monitoring = { + extraMetricInputs = [ "proxmox_normalize_metrics" ]; + extraLogInputs = [ "proxmox_normalize_logs" ]; }; services.openssh.enable = true;