Thanks for the reply.

I still have one small follow up question regarding "Answer to 2":
My question is in the context where I do NOT have another Prometheus on the 
client side to fetch with Federation, I just have an independant HTTP 
client that uses the remote HTTP API of Prometheus to fetch the metrics.

*Follow-up Question:* In this context, can my HTTP client use one HTTP 
request to fetch two different metrics at once or that is not possible?

Thanks a lot!

On Thursday, 12 March 2020 04:43:14 UTC-4, Brian Candler wrote:
>
> On Wednesday, 11 March 2020 22:38:11 UTC, Hakim Kahlouche wrote:
>>
>> Thanks for your reply.
>>
>> My question is about the PromQL calculation on metrics.
>>
>> Let's say I want to query the following:
>>
>> curl '
>> http://192.168.56.103:9090/api/v1/query?query=go_memstats_gc_cpu_fraction
>> '
>> curl '
>> http://192.168.56.103:9090/api/v1/query?query=node_cpu_seconds_total'
>>
>> Can I send one HTTP request only to fetch both metrics? That means, I 
>> would receive a JSON with two time-series.
>>
>> Is that possible?
>>
>
> You seem to be asking two different questions:
>
> 1. Can I use promQL to perform calculations between two different metrics?
> 2. Can I fetch two different metrics at once, and perform my own 
> calculations on the raw data?
>
> Answer to 1 is "yes".  The easiest calculations are between time series 
> which have exactly the same set of labels, but you can do more 
> sophisticated queries which match metrics based on subsets of labels.
>
> Answer to 2 is "yes", but as already said, you'd normally not use the 
> "query" endpoint for this, you'd be better using the "federate" endpoint 
> which can explicitly filter to the set of metrics you're interested in.
>

-- 
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/e169cf50-1825-41b4-9e74-24a2391b40e2%40googlegroups.com.

Reply via email to