Azure Monitor: Fix app insights source to allow for new __timeFrom and __timeTo (#21879)

* Fix app insights source to allow for new __timeFrom and __timeTo

* Try fixing the switch
torkelo-webpack-terser
Chad Nedzlek 5 years ago committed by GitHub
parent cd42b31da5
commit 0e7c746a87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      pkg/tsdb/azuremonitor/macros.go

@ -60,9 +60,9 @@ func (m *kqlMacroEngine) evaluateMacro(name string, args []string) (string, erro
timeColumn = args[0]
}
return fmt.Sprintf("['%s'] >= datetime('%s') and ['%s'] <= datetime('%s')", timeColumn, m.timeRange.GetFromAsTimeUTC().Format(time.RFC3339), timeColumn, m.timeRange.GetToAsTimeUTC().Format(time.RFC3339)), nil
case "__from":
case "__timeFrom", "__from":
return fmt.Sprintf("datetime('%s')", m.timeRange.GetFromAsTimeUTC().Format(time.RFC3339)), nil
case "__to":
case "__timeTo", "__to":
return fmt.Sprintf("datetime('%s')", m.timeRange.GetToAsTimeUTC().Format(time.RFC3339)), nil
case "__interval":
var interval time.Duration

Loading…
Cancel
Save