You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
common/model/value.go
Line 51 in 49b3603
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
The text was updated successfully, but these errors were encountered: