Summary
Restarting the monitor stack via rl-insight server start wipes the dynamically registered Prometheus scrape targets, so Prometheus stops scraping and every dashboard (agent_loop_trajectory, quick_start_demo, verl_tainer_* ) goes empty (e.g. run_id variable has no values).
Root cause
- The repo's
prometheus.yml is an empty template (scrape_configs: []); scrape targets are meant to be registered at runtime.
- Trainers / the monitor hub register themselves at startup via
update_prometheus_config() → PrometheusTargetStore.register(), which writes targets directly into the runtime prometheus.yml.
- On startup,
_render_prometheus_config() overwrites the runtime prometheus.yml from the repo template, discarding all dynamically registered targets.
- Prometheus stops scraping; instant queries return empty because samples go stale after ~5 minutes. The historical data itself is NOT lost (still in the TSDB).
Impact
- All dashboards sharing the Prometheus datasource are affected at once.
- Also affects anything relying on node_exporter / trainer metrics registered the same way.
- Broken ordering: hub started before
server start loses its registration; server restart after hub startup also loses it.
Suggested fix
Decouple static template from dynamic registration, e.g.:
- file_sd: put a fixed
scrape_configs entry with file_sd_configs pointing to a targets file (e.g. runtime/targets/trainer.yml); registration only updates that targets file, which server start does not touch.
- Or make
_render_prometheus_config() merge/keep existing runtime targets instead of overwriting.
Repro
- Start data generation (
generate_trace_data.py --metrics-report-port 9094) → dashboards show data.
- Run
rl-insight server start (restart).
curl http://localhost:9090/api/v1/targets → no active targets; all dashboards empty.
Environment
- Server: 178.139.22.6, container hxb_verl_0810
- rl-insight dev branch (tardis-key/rl-insight), Grafana 13.0.0 / Prometheus 2.54.1
- Runtime dir:
/root/.rl-insight/runtime, TSDB: /root/.rl-insight/data/prometheus (retention 30d)
Summary
Restarting the monitor stack via
rl-insight server startwipes the dynamically registered Prometheus scrape targets, so Prometheus stops scraping and every dashboard (agent_loop_trajectory, quick_start_demo, verl_tainer_* ) goes empty (e.g.run_idvariable has no values).Root cause
prometheus.ymlis an empty template (scrape_configs: []); scrape targets are meant to be registered at runtime.update_prometheus_config()→PrometheusTargetStore.register(), which writes targets directly into the runtimeprometheus.yml._render_prometheus_config()overwrites the runtimeprometheus.ymlfrom the repo template, discarding all dynamically registered targets.Impact
server startloses its registration; server restart after hub startup also loses it.Suggested fix
Decouple static template from dynamic registration, e.g.:
scrape_configsentry withfile_sd_configspointing to a targets file (e.g.runtime/targets/trainer.yml); registration only updates that targets file, whichserver startdoes not touch._render_prometheus_config()merge/keep existing runtime targets instead of overwriting.Repro
generate_trace_data.py --metrics-report-port 9094) → dashboards show data.rl-insight server start(restart).curl http://localhost:9090/api/v1/targets→ no active targets; all dashboards empty.Environment
/root/.rl-insight/runtime, TSDB:/root/.rl-insight/data/prometheus(retention 30d)