We have installed Grafana Alloy on a large number of servers. It’s working OK overall but on some servers with lots of users logged in and lots of processes running the Agent consumes 25% of CPU, independent of which collectors that are activated in the prometheus.exporter.windows components. No information found in logs.
Is there any configuration that can cause this behaviour?
config.alloy below:
// This reads prometheus files from C:\Program Files\GrafanaLabs\Alloy\textfile_inputs
prometheus.exporter.windows "userpromfiles" {
enabled_collectors = ["textfile"]
}
// This section initiates scraping of the winserver textfile collector
prometheus.scrape "userpromfiles" {
scrape_interval = "60s"
targets = prometheus.exporter.windows.userpromfiles.targets
forward_to = [prometheus.relabel.userfiles.receiver]
}
// This section sets the correct "instance" in lowercase (for windows server, the hostname)
prometheus.relabel "userfiles" {
forward_to = [prometheus.remote_write.testtenant.receiver]
rule {
source_labels = ["instance"]
regex = "(.*?)($|:.*)"
action = "replace"
replacement = "$1"
target_label = "instance"
}
rule {
source_labels = (["instance"])
action = "lowercase"
target_label = "instance"
}
}
// ---------------------------- Remote Write section ----------------------------------------
// Testtenant destination, used for testing of metric datastructure
// ALWAYS USE THIS DESTINATION WHEN TESTING
prometheus.remote_write "testtenant" {
endpoint {
url = "https://XXXXXX/api/v1/push"
headers = {
"tenantid" = "testtenant",
}
tls_config {
insecure_skip_verify = true
}
}
external_labels = {
"company"= to_lower(json_path(local.file.env.content,"Company")[0]),
"envgroup"= to_lower(json_path(local.file.env.content,"envgroup")[0]),
"env"= to_lower(json_path(local.file.env.content,"env")[0]),
"system"= to_lower(json_path(local.file.env.content,"system")[0]),
"dmz"= to_lower(json_path(local.file.env.content,"dmz")[0]),
"domain"= to_lower(json_path(local.file.env.content,"Domain")[0]),
}
}
// ----- Consume extra labels from OS (registry) exported by scheduled task -----
local.file "env" {
filename = "C:\\Program Files\\GrafanaLabs\\Alloy\\env.facts"
poll_frequency = "60m"
}
Thanks!
Jan