Can a dashboard link get the 'current' server name?

Sorry if this is an ‘easy’ question - I have spent some time searching for the clues, but without success.
I have a dashboard with a link to a page on the same server/FQDN (with a different port too). i.e. a ‘link’ Link, not a ‘dashboard’ Link.
The dashboard might be accessed from localhost but is also accessed from other machines
Is there a way to code the URL of the link so that it will insert the server name as per the dashboard URL being viewed? Currently I have it hard-coded as “localhost” which obviously won’t work from other machines. Basically I’m hoping there’s a way to specify the dashboard link as essentially a ‘relative URL’?

I can’t think of a way to do this (in a way that allows you need to change the port with respect to the one Grafana is being accessed on).

I don’t know your setup, but is there definitely a need to access the server via different hostnames? Can you not just always use the FQDN? (Or is there also a reverse proxy in the mix?)

Mainly it was to look to simplify our auto-deployment across multiple sites. But not essential - so yes, sounds like FQDN will have to be the way to go. Thanks for the feedback

1 Like