Template variable expansion in Explore link

I’m developing a custom log datasource plugin. I’ve successfully added template variable expansion by following this guide: Add support for variables | Grafana Plugin Tools. This works when I use the datasource plugin in conjunction with a Logs panel on a dashboard.

However, I’d like users to be able to use the Explore context menu link to go from the Logs panel to the Explore UI. Template variables are not expanded when following the Explore link. In the Explore UI, the pre-populated query remains untemplated: service=${service}, env=${env} (service and env being the template variables that I’d like to have expanded).

How can I make sure the Explore link in the panel context menu expands template variables?

1 Like

I have exactly the same issue. My log groups in AWS have an environment in them which I pull from a dashboard variable. This works fine in the dashboard but when a use clicks explore the environment variable does not get expanded in the new explore window.
Did you have any luck with this?

I could not get it to work, no.