citahub / cita-monitor

A Prometheus project to monitor running status of CITA.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

should auto update SoftVersion when cita bin is updated

rainchen opened this issue · comments

CITA bin was v0.20.2 and is updated with v0.24.1, but SoftVersion is still showing as v0.20.2

Screen Shot 2019-07-19 at 7 14 46 PM

commented

soft version 来自首次运行时查询结果产生
https://github.com/cryptape/cita-monitor/blob/9a6dfa6c7b4c786993c4474731ce5625adcac52d/agent/cita_monitor_agent.py#L34

每次请求不会有新的 soft version 查询
https://github.com/cryptape/cita-monitor/blob/9a6dfa6c7b4c786993c4474731ce5625adcac52d/agent/cita_monitor_agent.py#L378

所以导致如果没有重启 agent 就会出现 soft version 不会更新,主要考虑到 soft version 不是一个经常变更的数值,重复的查询会导致不必要的本地资源浪费以及 server 端的数据存储资源浪费;
更新 cita 版本后,理应需要重启 agent;

这个不是很合理,监控对象(cita 服务进程)可能会因故障挂机 或 进行停机升级维护,cita-monitor agent server 作为监控服务,应该能自动识别出监控对象的变化并记录这个结果,以后通过历史监控数据回顾时也能反映这个事件,而不应该依赖监控对象的运行状态来变更自身的运行状态