topk(10, count by (__name__, job)({__name__=~".+"})) Unexpected Token

108 views
Skip to first unread message

Random Person

unread,
Aug 3, 2022, 8:25:50 AM8/3/22
to Prometheus Users
Running into more OOM problems, and trying to use topk(10, count by (__name__, job)({__name__=~".+"})) . However the query always returns the following "Error executing query: Unexpected token i in JSON at position 1" . Is the only way to get data from this to increase query time limits ?

Thanks!

Julius Volz

unread,
Aug 4, 2022, 7:32:15 AM8/4/22
to Random Person, Prometheus Users
Hi,

That query itself should be ok, but if you get a JSON parsing error for the response coming back from Prometheus, that can indeed mean that your Prometheus died as a result of an OOM and whatever is in front of it returns invalid JSON in that case... probably no way to make it work without giving your Prometheus more memory, if that's the problem. Btw. you could switch '=~".+"' with "!=""' to get rid of regex matching, but that shouldn't make a difference.

Regards,
Julius

On Wed, Aug 3, 2022 at 2:25 PM Random Person <randompers...@gmail.com> wrote:
Running into more OOM problems, and trying to use topk(10, count by (__name__, job)({__name__=~".+"})) . However the query always returns the following "Error executing query: Unexpected token i in JSON at position 1" . Is the only way to get data from this to increase query time limits ?

Thanks!

--
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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/0e08a267-7180-4ec2-8ab0-72146371641bn%40googlegroups.com.


--
Julius Volz
PromLabs - promlabs.com
Reply all
Reply to author
Forward
0 new messages