Grafana图表即时指向Influx数据库

时间:2019-07-16 06:20:51

标签: grafana influxdb

我有一个包含多个数据库的influxdb设置,其中每个数据库的度量值都相似。我想创建一个通用的仪表板,用户可以在其中选择数据库,并即时将测量结果作为变量。

“ $ database”。“ autogen”。“ $ measurement” 中选择,其中yada yada

我不想为每个数据库复制n个不同的仪表板,有没有办法在查询本身中即时选择数据库?

2 个答案:

答案 0 :(得分:0)

创建查询时,请使用 Sub convertXLStoXLSX(ByVal directoryPath As String) Dim FSO As Scripting.FileSystemObject Dim strConversionPath As String Dim subFolderPath As String Dim fFile As file Dim fFolder As Folder Dim fSubFolder As Folder Dim wkbConvert As Workbook Application.ScreenUpdating = False Application.enableEvents = False strConversionPath = directoryPath Set FSO = New Scripting.FileSystemObject ' Check if the folder exists If FSO.FolderExists(strConversionPath) Then Set fFolder = FSO.GetFolder(strConversionPath) ' Loop through files, find the .xls files For Each fFile In fFolder.Files If Right(fFile.name, 4) = ".xls" Or Right(fFile.name, 4) = ".XLS" Then Application.StatusBar = "Converting " & fFile.name Application.displayAlerts = False Set wkbConvert = Workbooks.Open(fFile.Path, UpdateLinks:=False) ' Save as XML workbook - if file contains macros change FileFormat:=52 wkbConvert.SaveAs FSO.BuildPath(fFile.ParentFolder, left(fFile.name, Len(fFile.name) - 4)) & ".xlsx", FileFormat:=51 wkbConvert.Close SaveChanges:=False ' Delete original file fFile.Delete Force:=True Application.StatusBar = False Application.displayAlerts = True End If Next fFile 'move recursively into folders in this directory For Each fSubFolder In fFolder.SubFolders Application.StatusBar = "Checking Folder " & fSubFolder.Path subFolderPath = strConversionPath & fSubFolder.name & Application.PathSeparator convertXLStoXLSX (subFolderPath) Application.StatusBar = False Next fSubFolder End If Application.enableEvents = True Application.ScreenUpdating = True End Sub 获取数据库。我在grafana v5.2.2中对此进行了测试。 (将数据库的数据源设置为运行此查询的数据源)

答案 1 :(得分:0)

结果是Grafana不允许您在数据库之间切换,指定查询时必须首先选择它,并且当前只有一个数据库是无法参数化的选项