Get tag values in a given timeframe in OpenTSDB


I am successfully using templating with OpenTSDB to populate a drop-down menu with all the values of a tag for a particular metric.

However, the tag has a decent cardinality (>1000) and it seems Grafana always retrieves the entire list of distinct values, for the entire time series, despite the selected time frame. This makes the drop down menu of course a bit too long to handle.

It could help if Grafana retrieved the list of distinct values in the selected time frame. It seems like this information is available in OpenTSDB: if I understand correctly, every new tag value, at creation time, receives a UID and an entry in the tsdb-uid table with timestamp of its creation.

Of course I don’t know how Grafana queries OpenTSDB so I don’t know if that table is used at all.

Any thoughts on this?