I think what you are looking for is to do a "join", which in PromQL terms 
is some binary expression.
See for instance this 
article: https://www.robustperception.io/left-joins-in-promql/

You'd need to do a label_replace from "DBInstanceIdentifier" to "instance"

Also you can do `group by` to reduce one of the values to 1 so you can use 
* as the binary operator.

Bryan

On Friday 15 December 2023 at 15:34:44 UTC [email protected] wrote:

> Has anyone ever done any logic like this, or would have any idea how I can 
> solve this.
>
> I use WriteLatency{DBInstanceIdentifier=~"aurora-mysql.*"} > 0 to filter 
> who is the *master* of my database.
>
> The result of *Query 1* will be: 
> WriteLatency{DBInstanceIdentifier="aurora-mysql-2"} where *aurora-mysql-2* is 
> the *master* database.
>
> To validate the uptime, I use the following query 
> mysql_global_status_uptime{instance=" 
> <HERE>"}.
>
> I need the result of the *DBInstanceIdentifier* label in *Query 1* to be 
> inserted as a value in *Query 2* in the *instance* field. That way, I can 
> have a query in which I check the uptime of the master database only.
>

-- 
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/da1ce56b-2986-4918-99d4-c463fed59c86n%40googlegroups.com.

Reply via email to