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.