You can combine metrics using arithmetic, e.g.
memory_bytes / cpu_usage
assuming that (a) dividing those two metrics gives a meaningful result
(which is your responsibility), and (b) the two metrics have exactly the
same label sets (so the corresponding timeseries can be matched 1:1).
If they don't have identical label sets then using on(), ignoring() for 1:1
matches, and group_left or group_right for 1-to-many matches are possible.
They are documented here:
https://prometheus.io/docs/prometheus/latest/querying/operators/
There are also various blogs and tutorials - those
on www.robustperception.io are especially worth digesting.
On Tuesday, 7 September 2021 at 06:28:39 UTC+1 [email protected] wrote:
> i wanted to join to queries cpu_usage and memory_bytes for one namespace
> how can i do that ?
>
>
> On Monday, October 12, 2020 at 9:43:43 PM UTC+5:30 [email protected] wrote:
>
>> Ok, it looks like it's working as expected...
>> Thanks
>>
>> Le lundi 12 octobre 2020 à 15:48:31 UTC+2, [email protected] a écrit :
>>
>>> Try:
>>>
>>> label_replace(lldpLocPortDesc, "ifIndex", "$1", "lldpLocPortNum", "(.+)")
>>>
>>> If that works, then you should be able to build a query on top of this
>>> which uses (instance, ifIndex) as the join labels.
>>>
>>
--
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/246d0184-3e06-430f-b47b-5b6bf0d16fc1n%40googlegroups.com.