语法
参数
db_name- TimeSeries 表所在的数据库名称。time_series_table- TimeSeries 表的名称。promql_query- 使用 PromQL 语法 编写的查询。evaluation_time - 求值时间戳。要在当前时间对查询进行求值,请使用now()作为evaluation_time`。
返回值
promql_query 的查询结果类型,返回不同的列:
| 结果类型 | 结果列 | 示例 |
|---|---|---|
| vector | tags Array(Tuple(String, String)), timestamp TimestampType, value ValueType | prometheusQuery(mytable, ‘up’) |
| matrix | tags Array(Tuple(String, String)), time_series Array(Tuple(TimestampType, ValueType)) | prometheusQuery(mytable, ‘up[1m]‘) |
| scalar | scalar ValueType | prometheusQuery(mytable, ‘1h30m’) |
| string | string String | prometheusQuery(mytable, ‘“abc”‘) |