On Sunday, 15 March 2020 08:12:20 UTC+1, Yagyansh S. Kumar wrote: > > Hi. I want to add the dashboard link in the alert of that particular > service. That dashboard takes the server IP and hostname as input. From the > instance label, I want to remove the port number and pass it as input to be > dashboard. >
I strongly recommend you do the opposite: make sure the instance label doesn't contain the port number in the first place. This is described in outline here: https://www.robustperception.io/controlling-the-instance-label <https://www.robustperception.io/controlling-the-instance-label> The general idea is: copy the __address__ label explicitly to 'instance', and then add :9100 (or whatever) to the __address__ label. For example, the instance label is "foo.example.com" and the scraped address is "foo.example.com:9100" You can take this further, and have the instance label be a short/friendly name, while the address is either a FQDN or an IP address. For a working config which does this see https://github.com/candlerb/netbox-prometheus#targets -- 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 prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/55b0c074-518b-497b-8a20-04e49e669a6e%40googlegroups.com.