add option to include node exporter

This commit is contained in:
Arne Teuke
2025-06-13 16:28:56 +02:00
parent 7a1749a738
commit 38f597d115

View File

@@ -66,11 +66,21 @@ prometheus.scrape "scrape_system" {
}
<% if @ay_manage_ne == true -%>
prometheus.scrape "node_exporter" {
targets = [
{ __address__ = "localhost:9100" },)
]
targets = [{ __address__ = "localhost:9100" }]
forward_to = [prometheus.remote_write.prometheus.receiver]
scrape_interval = "15s"
relabel_configs = [
{
source_labels = [__address__]
target_label = "instance"
replacement = "localhost:9100"
},
{
source_labels = [__address__]
target_label = "job"
replacement = "node_exporter"
}
]
}
<% end %>
prometheus.remote_write "prometheus" {