HTTP API request for querying multiple metrics
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.
Read more here: Source link
