Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

400 errors should show the actual error in the query #67

Open
rshivane opened this issue Mar 19, 2020 · 0 comments
Open

400 errors should show the actual error in the query #67

rshivane opened this issue Mar 19, 2020 · 0 comments

Comments

@rshivane
Copy link
Contributor

Replication:
Fetch a missing metric using query API

Current behavior
The error raised does not indicate what is wrong with the query

Traceback (most recent call last):
  File "/home/ubuntu/Code/apptuit/tenants/bigbasket/es-glacier-snaphots/toktest.py", line 14, in <module>
    retry_count=3  # this will retry in case of 500 response or connection errors occur.
  File "/usr/local/lib/python2.7/dist-packages/apptuit/apptuit_client.py", line 362, in query
    "query service due to exception: %s" % str(http_error))
apptuit.apptuit_client.ApptuitException: Failed to get response from Apptuitquery service due to exception: 400 Client Error:  for url: https://api.apptuit.ai/api/query?start=1584607074&q=fetch%28%27missing_metric%27%29

Expectation
The API response has the error message that says the metric is missing. This message should be passed on to the API caller

{
   "status":"error",
   "message":"Query failed due to errors",
   "data":{
      "errors":[
         {
            "errorType":"ERROR_FETCHING_FROM_DATASOURCE",
            "queryLineNo":1,
            "queryColumnOffset":-1,
            "message":"Requested metrics(missing_metric) not found"
         }
      ]
   },
   "query_stats":{

   },
   "timing_diagnostics":[
   ],
   "query":{
      "querytext":"fetch('missing_metric')",
      "startTime":1584607112,
      "startTimeHumanReadableSYS":"March 19, 2020 8:38:32 AM UTC",
      "startTimeHumanReadableIST":"March 19, 2020 2:08:32 PM IST",
      "endTime":1584610762,
      "endTimeHumanReadableSYS":"March 19, 2020 9:39:22 AM UTC",
      "endTimeHumanReadableIST":"March 19, 2020 3:09:22 PM IST"
   }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant