> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-3a82795f.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> TimeSeries 테이블의 데이터를 사용해 Prometheus 쿼리를 평가합니다.

# prometheusQueryRange

평가 시간 범위 전반에 걸쳐 TimeSeries 테이블의 데이터를 사용해 Prometheus 쿼리를 평가합니다.

<div id="syntax">
  ## 구문
</div>

```sql theme={null}
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)
```

<div id="arguments">
  ## 인수
</div>

* `db_name` - TimeSeries 테이블이 있는 데이터베이스 이름입니다.
* `time_series_table` - TimeSeries 테이블 이름입니다.
* `promql_query` - [PromQL 구문](https://prometheus.io/docs/prometheus/latest/querying/basics/)으로 작성한 쿼리입니다.
* `start_time` - 평가 범위의 시작 시간입니다.
* `end_time` - 평가 범위의 종료 시간입니다.
* `step` - `start_time`부터 `end_time`까지(양 끝 포함) 평가 시간을 순회할 때 사용하는 간격입니다.

<div id="returned_value">
  ## 반환 값
</div>

이 함수는 매개변수 `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"')   |

<div id="example">
  ## 예시
</div>

```sql theme={null}
SELECT * FROM prometheusQueryRange(mytable, 'rate(http_requests{job="prometheus"}[10m])[1h:10m]', now() - INTERVAL 10 MINUTES, now(), INTERVAL 1 MINUTE)
```
