Query a metric from Prometheus and use current hostname as variable

Not sure about Prometheus, but in other rules Nagios Macros could be used:

https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/macrolist.html?mwg_rnd=4396589