Is there a way to access the url of a datasource as a variable?

The data source properties are available via the http api, but I’d like to use the base prometheus url as part of a data link.

I suspect it might be available as each Prometheus query has an “open this query in Prometheus” link, but can’t find any documentation on it.