This commit is contained in:
2026-04-09 11:26:38 +02:00
parent 672526bbca
commit 3a49f7f624
2 changed files with 16 additions and 0 deletions

View File

@@ -18,7 +18,11 @@ prometheus.exporter.windows "local" {
"service",
"logon",
"update",
"textfile",
]
textfile {
directory = "C:/ProgramData/Alloy/metrics"
}
}
prometheus.scrape "windows_exporter" {

12
get_version_chrome.ps1 Normal file
View File

@@ -0,0 +1,12 @@
# Crear directorio si no existe
$dir = "C:\ProgramData\Alloy\metrics"
if (!(Test-Path $dir)) { New-Item -ItemType Directory -Path $dir -Force }
# Obtener versión de Chrome
$path = "${env:ProgramFiles}\Google\Chrome\Application\chrome.exe"
if (Test-Path $path) {
$ver = (Get-Item $path).VersionInfo.ProductVersion
# Formato Prometheus: nombre_metrica{labels} valor
# Usamos valor 1 para que la métrica exista
"chrome_version_info{version=`"$ver`",arch=`"x64`"} 1" | Set-Content "$dir\chrome.prom" -Encoding ascii
}