# 新疆联通环境 nezha21.11版本 同一图表不同时间展示数据情况矛盾 | ID | Creation Date | Assignee | Status | |----|----------------|----------|--------| | OMPUB-284 | 2021-11-30T17:02:42.000+0800 | 贾依蒙 | 已关闭 | --- 联通XJ-Log-Middleware页面 JC-Log-Send图表,选取不同时间周期,图表展示数据情况不一致; promQL:jcSendFail     jcOutputLog   jcInputLog 如图示:最近1h,最近12h,最近24h 选取1h图表和选取12h图表显示有数据,选取24h图表数据变为0,12h和24h数据展示结果互相矛盾。 多次选择24h,会出现正常情况如图3,也会出现为0的情况如图4 选择XJ-Log-Middleware页面,有时会出现无任何显示的情况,如图5**fangshunjian** commented on *2021-11-30T17:17:32.354+0800*: 图片3 模糊,麻烦更新下 [~jiayimeng]  --- **jiayimeng** commented on *2021-11-30T17:50:50.388+0800*: 图片已更新 --- **fangshunjian** commented on *2021-12-01T10:47:59.532+0800*: 请检查 jcSendFail     jcOutputLog   jcInputLog  数据类型 --- **jiayimeng** commented on *2021-12-01T11:13:02.454+0800*: 三个指标均为gauge类型 --- **fangshunjian** commented on *2021-12-01T11:53:59.316+0800*: prometheus在查询时,可以根据step 设置查询精度,step 越大,精度越差,返回的数据总量越少。即返回结果每个 数据点的 时间间隔。 nezha 为了保证 浏览器 和 prometheus 性能,随着时间范围越长,也随之 设置更大的step * 小于1天 :15秒 * 小于7天 : 5分钟 * 小于30天:10分钟 * 大于等于30天:30分钟 另外prometheus 结果返回精度也和 scrape interval,promql(range-vector)相关 更多资料: * 1、metric 数据类型 [https://prometheus.io/docs/concepts/metric_types/] * 2、[https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries] * 3、[https://github.com/prometheus/prometheus/issues/2564] 建议:  方案1:修改 jcSendFail 等数据类型为 counter,通irate 或 rate 函数计算 平均速率 方案2: 保持当前数据类型,使用 统计函数 计算 [https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators] --- **fangshunjian** commented on *2021-12-01T13:44:27.131+0800*: 图5 bug已在 nezha-21.11.19-Release.x86_64.rpm 中修改,可更新nezha 程序解决 --- ## Attachments **23174/图3.png** --- **23178/图4.png** --- **23175/图5.png** --- **23166/图片1.png** --- **23165/图片2.png** ---