diff --git a/config.alloy b/config.alloy index 51eb5e7..638f47b 100644 --- a/config.alloy +++ b/config.alloy @@ -18,7 +18,11 @@ prometheus.exporter.windows "local" { "service", "logon", "update", + "textfile", ] + textfile { + directory = "C:/ProgramData/Alloy/metrics" + } } prometheus.scrape "windows_exporter" { diff --git a/get_version_chrome.ps1 b/get_version_chrome.ps1 new file mode 100644 index 0000000..4f2692d --- /dev/null +++ b/get_version_chrome.ps1 @@ -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 +} \ No newline at end of file