Evalúa una consulta de Prometheus con datos de una tabla TimeSeries en un intervalo de tiempos de evaluación.
prometheusQueryRange('db_name', 'time_series_table', 'promql_query', start_time, end_time, step)
prometheusQueryRange(db_name.time_series_table, 'promql_query', start_time, end_time, step)
prometheusQueryRange('time_series_table', 'promql_query', start_time, end_time, step)
db_name - El nombre de la base de datos donde se encuentra la tabla TimeSeries.
time_series_table - El nombre de una tabla TimeSeries.
promql_query - Una consulta escrita en sintaxis PromQL.
start_time - La hora de inicio del intervalo de evaluación.
end_time - La hora de finalización del intervalo de evaluación.
step - El paso utilizado para iterar el tiempo de evaluación desde start_time hasta end_time (ambos inclusive).
La función puede devolver distintas columnas según el tipo de resultado de la consulta proporcionada en el parámetro promql_query:
| Tipo de resultado | Columnas de resultado | Ejemplo |
|---|
| 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”‘) |
SELECT * FROM prometheusQueryRange(mytable, 'rate(http_requests{job="prometheus"}[10m])[1h:10m]', now() - INTERVAL 10 MINUTES, now(), INTERVAL 1 MINUTE)
Última modificación el 10 de junio de 2026