prometheusQuery テーブル関数
TimeSeries テーブルからのデータを使用して、prometheus クエリを評価します。
構文
引数
db_name- TimeSeries テーブルが存在するデータベースの名前。time_series_table- TimeSeries テーブルの名前。promql_query- PromQL 構文で書かれたクエリ。evaluation_time- 評価のタイムスタンプ。現在の時刻でクエリを評価するには、evaluation_timeとしてnow()を使用します。
戻り値
この関数は、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"') |