语法
参数
db_name- TimeSeries 表所在的数据库名称。time_series_table- TimeSeries 表的名称。promql_query- 按 PromQL 语法 编写的查询。start_time- 评估范围的起始时间。end_time- 评估范围的结束时间。step- 用于将评估时间从start_time逐步推进到end_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”‘) |