12 lines
532 B
PowerShell
12 lines
532 B
PowerShell
# 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
|
|
} |