본문으로 바로가기
본문으로 바로가기

timeSeriesSelector Table Function

지정된 셀렉터로 필터링하고 지정된 구간 내 타임스탬프를 가진 TimeSeries 테이블에서 시계열을 읽습니다. 이 함수는 range selectors와 유사하지만, instant selectors를 구현하는 데에도 사용됩니다.

구문

timeSeriesSelector('db_name', 'time_series_table', 'instant_query', min_time, max_time)
timeSeriesSelector(db_name.time_series_table, 'instant_query', min_time, max_time)
timeSeriesSelector('time_series_table', 'instant_query', min_time, max_time)

Arguments

  • db_name - TimeSeries 테이블이 위치한 데이터베이스의 이름입니다.
  • time_series_table - TimeSeries 테이블의 이름입니다.
  • instant_query - @ 또는 offset 수정자 없이 PromQL 구문으로 작성된 instant selector입니다.
  • min_time - 시작 타임스탬프(포함)입니다.
  • max_time - 종료 타임스탬프(포함)입니다.

반환 값

이 함수는 세 개의 컬럼을 반환합니다:

  • id - 지정된 셀렉터와 일치하는 시계열의 식별자를 포함합니다.
  • timestamp - 타임스탬프를 포함합니다.
  • value - 값을 포함합니다.

반환되는 데이터에는 특정 순서가 없습니다.

예제

SELECT * FROM timeSeriesSelector(mytable, 'http_requests{job="prometheus"}', now() - INTERVAL 10 MINUTES, now())