add prom logic and variables
This commit is contained in:
@@ -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 %>
|
||||
Reference in New Issue
Block a user