expected value after metric, got "MNAME"

414 views
Skip to first unread message

Alen Cappelletti

unread,
Jun 21, 2022, 5:14:24 AM6/21/22
to Prometheus Users
Hi all, I got this strange error...
I don't see any error on  my collector (it run from 6 month).
I've just downloaded on my docker app, last version of Prometheus...
but it's the same.

The strange think is that my metric page give me output of data..
So I'm a little bit confused... could be a collector error? Or a prometheus internal err?

  • expected value after metric, got "MNAME"
THANKS; Alen

Brian Candler

unread,
Jun 21, 2022, 5:47:23 AM6/21/22
to Prometheus Users
Where *exactly* do you see that error?

What do you see if you scrape your collector directly using curl?

If you save the scrape output, you can validate it with "promtool check metrics"

Alen Cappelletti

unread,
Jun 21, 2022, 6:47:25 AM6/21/22
to Prometheus Users
Thanks Brian for your reply...
I see no error on collector log or on prometheus log...
only from the TARGET (error) page on Prometheus.

I got 7 SQL endpoint.. and I isolate the one with the err.
I see directly from the DB query that 2 row have NULL values?
Could be this?
Now I try with a REPLACE NULL value directly on the query.... but your advise... "If you save the scrape output, you can validate it with "promtool check metrics", it's a good point of view.

I'll be back
Thanks, ALEN

Brian Candler

unread,
Jun 21, 2022, 7:50:59 AM6/21/22
to Prometheus Users
Here are a couple of cases from the prometheus test suite which show bad metrics that give exactly the error you see:

A metric name with no value is one of those, so your NULL theory looks likely to be correct.  You could try returning "NaN" for null values.

"promtool check metrics" gives a different error:

# echo "a" | /opt/prometheus/promtool check metrics
error while linting: text format parsing error in line 1: expected float as value, got ""

Alen Cappelletti

unread,
Jun 21, 2022, 8:18:28 AM6/21/22
to Prometheus Users
Yes... it was...
the NULL values.
Now all return run properly.

I've fixed with a classic ISNULL(field, 0) on my query....
THANKS

Reply all
Reply to author
Forward
0 new messages