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/374bb0de-2daf-4610-8a1b-2b14e60f0a20%40googlegroups.com.

Reply via email to