grafana-flowcharting icon indicating copy to clipboard operation
grafana-flowcharting copied to clipboard

relative links not working with sub_path configured in root_url

Open bijwaard opened this issue 4 years ago • 3 comments

With increasing number of grafana instances, I am now using a web-proxy to make them all available via a single https URL. However, using sub_paths in the URL (i.e. by changing the root_url in grafana.ini) breaks relative links in flowcharting that assume the URL starts at / instead of the sub_path.

I found that dashboard links already support the sub-paths, the links contain the sub-path. image

I could not find a global variable in the grafana documentation that makes the sub_path available, it would be great if such a (template) variable would be available in the flowcharting plugin. Alternatively, the sub-path can be pre-pended/prefixed by the flowchariting plugin when the user enters a relative URL.

I think automatically prefixing the sub_path is the most intuitive for the user, so he/she doesn't have to meddle with variables to link to another dashboard on the same grafana server.

Kind regards, Dennis

bijwaard avatar Oct 30 '20 10:10 bijwaard

added in roadmap

algenty avatar Oct 30 '20 10:10 algenty

Hi Arnoud, Thanks for adding it, I guess in javacript this sub_path would be available, since the dashboard links are already using it. Kind regards, Dennis

bijwaard avatar Oct 30 '20 10:10 bijwaard

Hi Arnaud, After some experimentation, I noticed that the relative URL works a bit different:

  • when URL starts with /, it doesn't add the sub_path
  • when URL starts without a /, it does add the sub_path automatically

This way it already works perfectly for me, I can start the URL with a / when linking to another grafana instance on the same web proxy. I can start the URL without a / to link to another dashboard in the same grafana instance.

So if we add a small explanation to the URL mapping help page, this issue can be closed. Kind regards, Dennis

bijwaard avatar Oct 30 '20 10:10 bijwaard