• /
  • EnglishEspañolFrançais日本語한국어Português
  • ログイン今すぐ開始

この機械翻訳は、参考として提供されています。

英語版と翻訳版に矛盾がある場合は、英語版が優先されます。詳細については、このページを参照してください。

問題を作成する

静的なNRQL条件の作成

|View as Markdown (English)

アクション識別子はnewrelic.alerts.createStaticNrqlConditionです。

アラートポリシーの下に新しい静的なNRQLアラート条件を作成します。静的なNRQL条件は、固定スケジュールでNRQLクエリを評価し、結果が固定された閾値を超えた場合に違反をオープンします。

termsまたはexpiration(openViolationOnExpiration: trueとともに)の少なくとも1つを指定する必要があります。両方を省略すると、NerdGraphの検証に失敗します。

次の表は、このアクションで利用可能なすべての入力フィールドについて説明しています。

入力

タイプ

説明

例

アカウントID

Int

必須。

条件を作成するNew Relicアカウント。

123456

policyId

弦

必須。

この条件を関連付けるアラートポリシーのID。

"2000002"

name

弦

必須。

条件の名前。

"High error rate"

nrqlQuery

弦

必須。

評価するNRQLクエリです。

"SELECT count(*) FROM TransactionError WHERE appName = 'MyApp'"

有効

ブール値

必須。

条件がアクティブかどうか。

true

用語

リスト

条件付きで必須です。

条件の閾値。

expiration

が

openViolationOnExpiration: true

とともに指定されない限り、必須です。各エントリには次が必要です:

priority

(

CRITICAL

または

WARNING

)、

operator

(

ABOVE

、

ABOVE_OR_EQUALS

、

BELOW

、

BELOW_OR_EQUALS

、

EQUALS

、または

NOT_EQUALS

)、

threshold

(フロート)、

thresholdDuration

(秒)、および

thresholdOccurrences

(

ALL

または

AT_LEAST_ONCE

)。

[{"priority": "CRITICAL", "operator": "ABOVE", "threshold": 5, "thresholdDuration": 300, "thresholdOccurrences": "ALL"}]

nrqlDataAccountId

Int

オプション。

accountId

と異なる場合に、NRQLクエリを実行する対象のアカウントです。

123456

description

弦

オプション。

条件のフリーテキストによる説明。

"Alerts when the error rate exceeds the threshold."

runbookUrl

弦

オプション。

条件からリンクするランブックのURL。

"https://runbooks.example.com/high-error-rate"

titleTemplate

弦

オプション。

違反タイトルのHandlebarsスタイルのテンプレート。

"{{ conditionName }} on {{ entity.name }}"

ビオレーションタイムリミットセコンド

Int

オプション。

指定した秒数後に、オープン状態の違反を強制的にクローズします。

86400

シグナル

地図

オプション。

高度なシグナルおよびストリーミング設定:

aggregationWindow

、

aggregationMethod

(

EVENT_FLOW

、

EVENT_TIMER

、または

CADENCE

)、

aggregationDelay

、

aggregationTimer

、

slideBy

、

evaluationDelay

、

fillOption

(

NONE

、

LAST_VALUE

、または

STATIC

)、

fillValue

、

pollingFrequency

。

{"aggregationWindow": 60, "aggregationMethod": "EVENT_FLOW", "aggregationDelay": 120}

有効期限

地図

オプション。

シグナルロス設定:

closeViolationsOnExpiration

、

expirationDuration

(秒)、

openViolationOnExpiration

、

ignoreOnExpectedTermination

。

{"closeViolationsOnExpiration": true, "expirationDuration": 300, "openViolationOnExpiration": false}

selectors

リスト

オプション。

レスポンスから値を抽出するためのJQセレクター。

selectors:
- name: conditionId
expression: ".data.alertsNrqlConditionStaticCreate.id"

次の表は、このアクションによって返されるすべての出力フィールドについて説明しています。

出力

タイプ

説明

success

ブール値

true

ステップがエラーなしで実行された場合。

errorMessage

弦

NerdGraphエラーを含む、失敗時のエラーメッセージです。成功した場合は

null

。

データ

地図

NerdGraphのレスポンス。dataからid、name、enabled、policyId、entityGuid、またはtypeを抽出するには、selectorsを使用します。

{
"data": {
"alertsNrqlConditionStaticCreate": {
"id": "7654321",
"name": "High error rate",
"enabled": true,
"policyId": "2000002",
"entityGuid": "MTE5MzMzNDd8TlIxfE5SUV9DT05EQVRJT058NzY1NDMyMQ",
"type": "STATIC"
}
}
}

次の例では、静的なNRQL条件を作成し、後続の手順で使用するためにそのIDをキャプチャします。

ワークフローの例

name: create_static_nrql_condition
description: Create a static NRQL alert condition
steps:
- name: createCondition
type: action
action: newrelic.alerts.createStaticNrqlCondition
version: 1
inputs:
accountId: ${{ .workflowInputs.accountId }}
policyId: ${{ .workflowInputs.policyId }}
name: "High error rate"
nrqlQuery: "SELECT count(*) FROM TransactionError WHERE appName = 'MyApp'"
enabled: true
terms:
- priority: "CRITICAL"
operator: "ABOVE"
threshold: 5
thresholdDuration: 300
thresholdOccurrences: "ALL"
selectors:
- name: conditionId
expression: ".data.alertsNrqlConditionStaticCreate.id"
next: end
Copyright © 2026 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.