__range template variable support for datasources

Could someone explain why the $__range variable has limited availability in datasources as mentioned here: Add variables | Grafana documentation

I am trying to use it in a promql query for a Cloud Monitoring datasource. Isn’t in the end the same mechanism used for $__interval variable which is available? I don’t understand what is different about the range.

Hi @eugeniu ,

  1. not sure what’s the reason current the $_range only for specific datasource, but maybe you can use $__to - $_from instead.
  2. the $_internal is data point interval not the time range related

Hi @smarkm . Thanks for replying. How do I combine $__to and $__from into a result? I tried different variants but it didn’t work, e.g. ${__to} - ${__from} gets substituted as the difference of 2 values in the query, not their result.