What Grafana version and what operating system are you using?
Grafana v9.5.14, windows 11.
What are you trying to achieve?
In the timeseries plot in Grafana I am creating a panel title that depends on the variable the user chooses. In some cases, the title should end with the value of the inbuilt variable __interval. Importantly __interval cannot be referenced in the variable settings.
How are you trying to achieve it?
The panel title is as follows: ${panel_title_variable:text} ${__interval}. In the cases where __intervall should not be shown I pad the panel_title_variable with 300+ duplicates of an invisible character.
What happened?
While the solution is not pretty from a back-end perspective, the user cannot see the ${__interval} in the cases where it should not be shown. The problem is that when the user exports to csv, the file name of the csv file is the panel title. In the cases where ${__interval} should be hidden the invisible characters causes the file name to be to long for EXCEL to open.
A possible remedy action could be to calculate __interval in a separate variable. I would rather not do that.
I don’t understand what is a problem. You can’t have everything, because everything has some limits and you are reaching them right now. So you have to sacrifise something.
In the cases where __intervall should not be shown I pad the panel_title_variable with 300+ duplicates of an invisible character.
That doesn’t look very smart. What if user will open single panel on wide screen? Will you add 3000+ invisible characters?
Why you are not keeping it simple - just remove that variable from the title?
I agree that the solution is not smart. However, I have not found a remedy action.
Let me try to explain it with an example.
The panel title variable depends on the number of values returned by the query.
It is defined like:
If number of values > 200k
then use Grafana suggested re-sampling.
let the title variable be: "Values are shown with a re-sampling interval of: "
If number of values <= 200k
then use raw values from the database.
let the title variable be: “Raw values are shown.”
Now if I use the panel title ${panel_title_variable:text} ${__interval} and we assume __intervall is 5m (5 minutes) we get the following cases:
If number of values values > 200k
The panel tittle is: “Values are shown with a re-sampling interval of: 5m” ← This is what we want.
If number of values values <= 200k
The panel tittle is: “Raw values are shown. 5m” ← This is what we want, except for the 5m