In fact I switched IP addresses to post here.

Perfect, the two methods you gave me are possible to get where I needed. I
would like to thank you for your support and attention to my question. I
managed to solve my problem!

On Fri, Nov 5, 2021 at 5:04 AM Brian Candler <[email protected]> wrote:

> On Thursday, 4 November 2021 at 19:00:50 UTC [email protected] wrote:
>
>> 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.
>>
>>
> I don't see how you can get *instance="0.0.0.0:9221
> <http://0.0.0.0:9221>"*.  How does a scrape to 0.0.0.0 work?  Or have you
> replaced the real IP with 0.0.0.0 when posting?
>
> You need some way to identify the clusters in the metrics, and I would
> have expected this to be via the instance label: e.g. instance "qemu/100"
> on two different clusters might appear as
>
>     pve_up{id="qemu/100",*instance="192.0.2.3:9221
> <http://192.0.2.3:9221>"*,job="PVE-Cluster"}
>     pve_up{id="qemu/100"*,instance="172.16.4.5:9221
> <http://172.16.4.5:9221>"*,job="PVE-Cluster"}
>
> If that's the case, the pair (id,instance) is your unique instance
> identifier that you can join on.
>
> If not, then you need to find some other way to do this.  A good way is to
> use instance relabelling to control the instance label
> <https://www.robustperception.io/controlling-the-instance-label>:
>
>     pve_up{id="qemu/100"*,instance="pve_cluster1"*,job="PVE-Cluster"}
>
> Or you could add another label at scrape time, e.g. via your targets file:
>
>     pve_up{id="qemu/100",instance="0.0.0.0:9221",job="PVE-Cluster",
> *cluster="cluster1"*}
>
> Or you could scrape them using two different jobs (this is the least
> scalable as you need to replicate your scrape config for every cluster):
>
>     pve_up{id="qemu/100",instance="0.0.0.0:9221",*job="PVE-Cluster1"*}
>
> Then your join would be on (id,instance) or (id,cluster) or (id,job)
> respectively.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Prometheus Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/prometheus-users/DdLfQkzoZLA/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/080b69c6-43bf-45b4-80b2-ba65d35c959en%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/080b69c6-43bf-45b4-80b2-ba65d35c959en%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CACDUYHwaXBHwbnJ4eDbFPZxOqN_4QTEPsCcSo9ZwMw3WE-Jdwg%40mail.gmail.com.

Reply via email to