Bryan, first of all thank you very much for the clarifications, the
explanation was great.
About the meaning of my metric, it is to know when any virtual machine goes
offline in my cluster. However I have more than one cluster in my
environment. This generates repeated VM ID's.
When I run my "pve_up" query, it brings me:
pve_up{id="qemu/100",instance="0.0.0.0:9221",job="PVE-Cluster"}
Where ID refers to the machine created in the cluster and if there is more
than one, therefore, two identical ID's.
Using your query "count by (id) (pve_guest_info) > 1" I found which ID's
are repeated, but I still don't know how to get around it.
When I run my "pve_guest_info" query it brings me:
pve_guest_info{id="qemu/100",instance="0.0.0.0:9221
",job="PVE-Cluster",name="lab01",node="MyNode",type="qemu"}
So, through the repeating ID I would need to get the information from a
repeating ID, I have no idea how to solve this, since the ID's are repeated
and I need them to generate my reference, or is there another way?
Thank you very much.
On Thursday, November 4, 2021 at 12:02:22 PM UTC-3 Brian Candler wrote:
> To debug it, simply run the two halves separately:
>
> (a) pve_up == 0
> (b) pve_guest_info
>
> Match up the the timeseries from (a) and (b) with identical "id" value. I
> think you'll find at least one case where a particular value of "id" links
> to more than one (a) and more than one (b).
>
> group_left requires that multiple instances of (a) map to exactly one
> instance of (b). So another query to try is:
>
> count by (id) (pve_guest_info) > 1
>
> and see if you can find multiple instances of pve_guest_info for the same
> "id".
>
> If you do, then the solution depends on the meaning of the metric. Is
> "id" only unique when in combination with some other label? Then join on
> both labels at once:
>
> (pve_up == 0) * on(id, foo) group_left(name) pve_guest_info
>
> where "foo" is this other label. (Clearly it has to exist on both pve_up
> and pve_guest_info metrics though)
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/7ef9459e-d16c-43ee-a024-143ad3a0dbcan%40googlegroups.com.