Aleksandr Rogozin
Blog
Blog
Aleksandr Rogozin

Adding short hostname label in PromQL

Short hostname takes up less space and allows to supply more information in metric legend. Example below will create an additional label short_hostname.

label_replace(your_metric, "short_hostname", "$1", "hostname", "([^.]*).*")
NotesAleksandr RogozinMay 24, 2019prometheus, promql
Facebook0 Twitter LinkedIn0 Reddit Tumblr 0 Likes
Previous

Network Automation through DNS using Response Policy Zones

dnsAleksandr RogozinSeptember 12, 2019dns, bind, rpz, network, automation

Powered by Squarespace