@echo off
rem ===================================================================
rem  Grafana (관측성 B4 시각화) — Prometheus(:9090) 위에 대시보드.
rem  포터블: apps\grafana-13.1.0, 데이터 home\grafana-data.
rem  프로비저닝: infra\grafana\provisioning (Prometheus 데이터소스 + RTGS 대시보드 자동).
rem  UI: http://localhost:3000  (익명 Admin 허용 — 로그인 없이 조회/편집)
rem ===================================================================
set "GF=C:\ai-dev\apps\grafana-13.1.0"
set "GF_PATHS_HOME=%GF%"
set "GF_PATHS_DATA=C:\ai-dev\home\grafana-data"
set "GF_PATHS_LOGS=C:\ai-dev\home\grafana-data\log"
set "GF_PATHS_PROVISIONING=C:\ai-dev\workspace\rtgs\infra\grafana\provisioning"
set "GF_SERVER_HTTP_PORT=3000"
set "GF_AUTH_ANONYMOUS_ENABLED=true"
set "GF_AUTH_ANONYMOUS_ORG_ROLE=Admin"
set "GF_USERS_DEFAULT_THEME=light"
if not exist "%GF_PATHS_DATA%" mkdir "%GF_PATHS_DATA%"
echo [grafana] starting on :3000 (datasource=Prometheus:9090, dashboard=RTGS Overview)...
start "Grafana :3000" "%GF%\bin\grafana.exe" server --homepath "%GF%"
echo [grafana] UI: http://localhost:3000  (Dashboards ^> RTGS Overview)
