by shigemk2

当面は技術的なことしか書かない

Datadog Monitor クエリの time_window(last_)仕様メモ

クエリ構文

time_aggr(time_window):space_aggr:metric{tags} [by {key}] operator #

time_window に設定できる値

通常の time_aggr(avg, sum, max, min

フォーマット 範囲 備考
last_#m 1〜10080 モニタータイプにより異なる
last_#h 1〜168 モニタータイプにより異なる
last_1d 固定
last_1w 固定

change / pct_change の場合

クエリ構文が異なり、timeshift パラメータが追加で必要になる。

change_aggr(time_aggr(time_window), timeshift):space_aggr:metric{tags} [by {key}] operator #
フォーマット 範囲 備考
last_#m 1〜2880 通常より狭い
last_#h 1〜48 通常より狭い
last_#d 1 or 2

timeshift に設定できる値

フォーマット 設定可能な値
#m_ago 5, 10, 15, 30
#h_ago 1, 2, 4
#d_ago 1

注意点

  • time_aggr の種類(通常 vs change/pct_change)によって last_ の設定可能範囲が異なる
  • モニタータイプ(metric alert, log alert 等)によっても上限が変わる可能性がある
  • change / pct_change では last_1w は使用不可

公式ドキュメント