add prom logic and variables

This commit is contained in:
Arne Teuke
2025-02-24 15:23:20 +01:00
parent e8180a1061
commit c182cdae84
2 changed files with 35 additions and 5 deletions

View File

@@ -1,3 +1,4 @@
<% if @ay_manage_loki == true -%>
logging {
level = "info"
format = "logfmt"
@@ -20,4 +21,28 @@ loki.write "loki" {
password = "<%= @ay_loki_userpass %>"
}
}
}
}
<% end -%>
<% if @ay_manage_prom == true -%>
// Metrics collection
prometheus.exporter.unix "system_metrics" {
include_exporter_metrics = true
disable_collectors = ["mdadm"] # Optional: adjust based on your needs
}
prometheus.scrape "scrape_system" {
targets = prometheus.exporter.unix.system_metrics.targets
forward_to = [prometheus.remote_write.prometheus.receiver]
scrape_interval = "15s" # Adjust as needed
}
prometheus.remote_write "prometheus" {
endpoint {
url = "<%= @ay_prom_url %>"
basic_auth {
username = "<%= @ay_loki_username %>"
password = "<%= @ay_loki_userpass %>"
}
}
}
<% end %>