0

I have a function that queries the Log Analytics Batch endpoint (https://api.loganalytics.io/v1/$batch) ~450 times a day, out of which ~60 requests return a 502 Bad Gateway.

It is always the same query and it usually returns around 100 rows total in less than 15 seconds, so it is nowhere near the API limits:

  • Queries cannot return more than 500,000 rows
  • Queries cannot return more than 64,000,000 bytes (~61 MiB total data)
  • Queries cannot run longer than 10 minutes (by default 3 minutes)

This is the error description from the documentation:

Bad Gateway. A downstream service dependency experienced an internal service error while processing the request

Does anyone knows what this mean or what can I do to avoid it?

Velair
  • 227
  • 3
  • 12
  • 1
    Are your API calls going through a proxy or firewall on your end? Do you have any additional error handling that includes more details about the 502 error? – shelum Feb 20 '19 at 15:59
  • I don't think so, the code is running in an Azure Function that's querying a Log Analytics in the same Resource Group but I don't know how Azure handles the requests in between. The response only says the Bad Gateway message without more detail – Velair Feb 22 '19 at 02:17
  • The backend server which your are accessing has the limitation that the query of the response can’t be more than 64MB like you mentioned in the second bollet. Is it possible to minimize the query output, perhaps project the certain columns you need? – Raz Ronen Jun 07 '19 at 03:30

0 Answers0