Thanks for your response.

If I do `ltmPoolMbrStatusAvailState * 
on(instance,ltmPoolMbrStatusNodeName,ltmPoolMbrStatusPoolName,ltmPoolMbrStatusPort)
 
group_right ltmPoolMbrStatusEnabledState` I get:

`{instance="ltm01", job="f5_ltm_test", ltmPoolMbrStatusEnabledState="1", 
ltmPoolMbrStatusNodeName="/Common/VPN1", 
ltmPoolMbrStatusPoolName="/Common/Pool1", ltmPoolMbrStatusPort="4500", 
prometheus="monitoring/k8s", prometheus_replica="prometheus-k8s-0"}`

So this has `ltmPoolMbrStatusEnabledState` but not 
`ltmPoolMbrStatusAvailState`. If I swap the metrics round:

`ltmPoolMbrStatusEnabledState * 
on(instance,ltmPoolMbrStatusNodeName,ltmPoolMbrStatusPoolName,ltmPoolMbrStatusPort)
 
group_right ltmPoolMbrStatusAvailState`. I get:

`{instance="ltm01", job="f5_ltm_test", ltmPoolMbrStatusAvailState="1", 
ltmPoolMbrStatusNodeName="/Common/VPN1", 
ltmPoolMbrStatusPoolName="/Common/Pool1", ltmPoolMbrStatusPort="4500", 
prometheus="monitoring/k8s", prometheus_replica="prometheus-k8s-0"}`

This has `ltmPoolMbrStatusAvailState` but not `ltmPoolMbrStatusEnabledState`

So it seems I can get one or the other, not both. Unless im forming my 
PromQL wrong?

On Tuesday, 7 March 2023 at 08:31:39 UTC Brian Candler wrote:

> It has to be done in a query - the relabelling phase of a scrape job 
> cannot see other metrics.
>
> What you are looking for is one-to-many queries, which can pick up labels 
> from the "one" side and apply them to the "many":
>
> https://www.robustperception.io/how-to-have-labels-for-machine-roles
> https://www.robustperception.io/exposing-the-software-version-to-prometheus
>
> https://prometheus.io/docs/prometheus/latest/querying/operators/#many-to-one-and-one-to-many-vector-matches
> https://www.robustperception.io/left-joins-in-promql
>
> > I have tried doing a join but it only seems to bring in one of the 
> `ltmPoolMbrStatusEnabledState` and `ltmPoolMbrStatusAvailState` metrics 
> depending on if its a left or right join, but I would like both to appear.
>
> Can you show what query you did, the raw metrics which it used, what 
> result you got, and what you wanted to get instead?
>

-- 
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/9e097ded-7211-4b4f-9c4d-1e91a8511bb2n%40googlegroups.com.

Reply via email to