vector cannot contain metrics with the same labelset

805 views
Skip to first unread message

Adso “Cho” Castro

unread,
May 30, 2023, 4:28:35 PM5/30/23
to Prometheus Users
Hey, been getting the error below when querying:

execution: vector cannot contain metrics with the same labelset

The query:

sum(rate(istio_requests_total{reporter="source", destination_workload="dummy-data", response_code=~"2.."}[$_range])) by (destination_workload) / sum(rate(istio_requests_total{reporter="source", destination_workload="dummy-data"}[$_range])) by (destination_workload)

Funny thing is, this is a Thanos installation. I have a Cortex installation with the same data and this query works fine.

Thanks

Julius Volz

unread,
May 30, 2023, 5:02:26 PM5/30/23
to Adso “Cho” Castro, Prometheus Users
Nothing in the query itself should be able to cause a duplicate labelset in a normal PromQL execution, so I assume that something is wrong with the underlying Thanos setup or code. Maybe it somehow manages to select the same duplicate time series from multiple Prometheus servers (or the long-term storage), because something around the external labels normally used for differentiating series isn't configured or working properly?

--
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/b08f43a8-fd11-4775-838e-350f144df8e8n%40googlegroups.com.


--
Julius Volz
PromLabs - promlabs.com

Adso “Cho” Castro

unread,
May 31, 2023, 9:07:48 AM5/31/23
to Prometheus Users
Hey Julius, morning

Found a few warn logs from thanos-receive, maybe a possible root cause?

- "Error on ingesting samples with different values but same timestamp"
- "Error on ingesting out-of-order samples"

Julius Volz

unread,
May 31, 2023, 10:43:41 AM5/31/23
to Adso “Cho” Castro, Prometheus Users
That's the TSDB complaining about a related problem where multiple series with the same label identity are likely coming in. But that shouldn't lead to PromQL queries receiving the same series multiple times in a vector selector unless something is broken in the TSDB / Thanos data merging layer underneath PromQL. Could you share all the details of your Thanos setup (how many Prometheus servers with which external labels do you have, how are you merging them together with Thanos, which Thanos and Prometheus versions are you using, are you using object storage for long-term data, etc.)? Might at some point be a better question / bug report for the Thanos folks though.

Adso “Cho” Castro

unread,
May 31, 2023, 11:43:10 AM5/31/23
to Prometheus Users
Oh I see. I agree with that idea, I'm gonna move this discussion to their github issues.

Thank you!

Adso “Cho” Castro

unread,
Jun 16, 2023, 1:29:08 PM6/16/23
to Prometheus Users
Julius, just to keep you updated about this topic, it was a bug from Thanos 0.31.0. I rolled back to the 0.30.0 e the query worked fine. Looks like there is a thread about the issue already and Plotka is looking into it.

Thank you again!

Reply all
Reply to author
Forward
0 new messages