Files
geedge-jira/md/OMPUB-284.md
2025-09-14 21:52:36 +00:00

111 lines
2.5 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 新疆联通环境 nezha21.11版本 同一图表不同时间展示数据情况矛盾
| ID | Creation Date | Assignee | Status |
|----|----------------|----------|--------|
| OMPUB-284 | 2021-11-30T17:02:42.000+0800 | 贾依蒙 | 已关闭 |
---
联通XJ-Log-Middleware页面 JC-Log-Send图表选取不同时间周期图表展示数据情况不一致
promQLjcSendFail     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 intervalpromqlrange-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**
---