Template variables after upgrade 4.30 to 5.1.0

We recently upgraded from grafana 4.3.0 to 5.1.0. and have noticed that some of our dashboards created prior to the upgrade are no longer working due to no results being returned in template variables.

  • Existing dashboards that had prometheus-backed template variables in the form of label_values(metric,label) now return no data.

  • Modifying these old dashboards and changing the function to label_values(label) does return values.

  • Creating a brand new (5.1.0) dashboard and using the same label_values(metric,label) function that was defined in the old dashboard does return data.

Is anyone aware of a dashboard migration step that needs to be performed in order to bring old dashboard definitions up to version 5 compliance?

This strange, we have no other reports about this. Can you have chrome dev tools network tab open and inspect what query grafana sends for the variable values ? Also check console for any ja errors

Thanks for the idea of looking at the chrome dev tools. That revealed that when I was using label_values(metric,label) the api call was using a start and end where the values were associated with a datetime long since passed and definitley aged out of our prometheus.

It’s embarrassing, but I dind’t notice that the dashboard time range had been set to these old values. Updating that range applied a more current start/end criteria to the api call that the template variable used.




What’s interesting is that when you call label_values(label) it doesn’t add the start and end criteria and the api call looks like this: