Hi,

We were given a try on the new @ operator, but we got uncanny results.

First using time:

$ curl -s '
http://localhost:9090/api/v1/query?query=scrape_duration_seconds%7Bjob=
"prometheus"%7D&time=2021-11-26T09:39:21.000Z' | jq .
{
 "status": "success",
 "data": {
   "resultType": "vector",
   "result": [
     {
       "metric": {
         "__name__": "scrape_duration_seconds",
         "instance": "localhost:9090",
         "job": "prometheus"
       },
       "value": [
         1637919561,
         "0.00721538"
       ]
     }
   ]
 }
}

As can be seen, time returned at value is 1637919561, which matches the
time sent:

In [9]: time.strftime("%Y-%m-%dT%H:%M:%S.000", time.gmtime(1637919561))
Out[9]: '2021-11-26T09:39:21.000'

But once using the @ operator, got a different result:

$ curl -s '
http://localhost:9090/api/v1/query?query=scrape_duration_seconds%7Bjob=
"prometheus"%7D@1637919561' | jq .
{
 "status": "success",
 "data": {
   "resultType": "vector",
   "result": [
     {
       "metric": {
         "__name__": "scrape_duration_seconds",
         "instance": "localhost:9090",
         "job": "prometheus"
       },
       "value": [
         1638787945.238,
         "0.00721538"
       ]
     }
   ]
 }
}

The data values is the same for both: 0.00721538.

But the time in value response not.

In [10]: time.strftime("%Y-%m-%dT%H:%M:%S.000", time.gmtime(1638787945.238))

Out[10]: '2021-12-06T10:52:25.000'

Which is the time right now.

So that's my question.  Are we doing something wrong on the query using @
operator?

Best Regards,
Helio Loureiro

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAPxLgJLTkTK6Ly%2B0edX1fXeGdZfTxZ8TKUTs-8J_F2%2BZTsopoQ%40mail.gmail.com.

Reply via email to