Wrong json umarshal bug for model value
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 model/value.go 第 51 行附近开始,检查 query-range 响应值是如何被 unmarshalled 的。使用提供的查询、时间戳和 step 重现报告,然后将客户端结果与直接的 curl 响应进行比较。当 unmarshalled 后的时间戳和值数据与 Prometheus 响应匹配时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
I found a strange bug, the response data unmarshalled by prom client-go is wrong by chance.
I use the queryRange API provided by prometheus client go as followings
and i print the time series data returned by the queryRange api, it has unexpected data value. it is very large and unexpected.

the value logged function is below, i use json marshal directly to marshal the returned data by api, i am sure that this is the data returned by prometheus client-go api queryRange function:
and then i use curl curl -G --data-urlencode 'query=irate(container_cpu_usage_seconds_total{container!="POD",namespace="ns-prjchlvc-1544041-production",pod=~"^monitor-server-siliconvalley-150001.*$",container="second-monitor-server"}[3m])' --data-urlencode 'start=1658205420.000' --data-urlencode 'end=1658865360.000' --data-urlencode 'step=60' http://127.0.0.1:9090/api/v1/query_range to query the prometheus directly, it returned normal data as expected. you can see the following data timestamp and value, it is what we want. but the above image is use the client-go api, with the same param, it has unexpected value at the same timestamp.

So i think the json unmarshal has some bug the prometheus client go impelmented
- 主要语言
- Go
- 星标
- 297
- 派生
- 380
- 平均合并
- 3 天 15 小时
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
prometheus/common 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 35/100
prometheus/common#1023 ·
维护者通常 2 天内回复
-
expfmt: OpenMetrics 1.0 output with a unit that is not a name suffix fails the whole scrape in Prometheus可能已有人在做 @itsmeasadali 于 40 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 58/100
prometheus/common#1005 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 52/100
prometheus/common#876 · 1 条评论 ·
维护者通常 2 天内回复
-
Feature request: Add client_assertion field for oauth2 jwt-bearer grant type可能已有人在做 @alliasgher 于 218 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
prometheus/common#869 ·
维护者通常 2 天内回复
-
难度 5/5 一周以上 新手友好度 30/100
prometheus/common#858 ·
维护者通常 2 天内回复
查看 prometheus/common 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
txn2/mcp-data-platform#2728 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
blinklabs-io/dingo#6504 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
SocialGouv/iterion#3413 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 88/100
orion-belt-dev/orion-belt#181 ·
维护者通常 1 天内回复
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 79/100
kubesmarts/logic-operator#105 ·
维护者通常 1 天内回复