diff --git a/roles/grafana/templates/vmagent.yaml.j2 b/roles/grafana/templates/vmagent.yaml.j2 index 7c6d63f..1c0cf29 100644 --- a/roles/grafana/templates/vmagent.yaml.j2 +++ b/roles/grafana/templates/vmagent.yaml.j2 @@ -48,14 +48,16 @@ scrape_configs: relabel_configs: - source_labels: [__address__] target_label: instance - regex: '(.*):{{ monitoring_ports.proxmox_exporter }}' + regex: '([^:]+)(:\d+)?' + replacement: '${1}' + action: replace + - source_labels: [__address__] + target_label: __address__ + regex: '([^:]+)(:\d+)?' replacement: '${1}' action: replace metric_relabel_configs: # Исключаем остановленные контейнеры (pve_up=0) - - source_labels: [__name__] - regex: 'pve_up' - action: keep - source_labels: [pve_up] regex: '0' action: drop