Skip to content

Instantly share code, notes, and snippets.

@y0t4
Created December 16, 2021 07:41
Show Gist options
  • Save y0t4/89fe6f2ac48174a5a7e8a8f4cbcfb814 to your computer and use it in GitHub Desktop.
Save y0t4/89fe6f2ac48174a5a7e8a8f4cbcfb814 to your computer and use it in GitHub Desktop.
newrelicのalbアラートで5xx系の設定をしたい場合に使用するapiの流れ
curl -X GET --header "X-Api-Key: ${API_KEYを入れる}" "https://infra-api.newrelic.com/v2/alerts/conditions?policy_id=${ポリシーのid}" | jq .
curl -X GET --header "X-Api-Key: ${API_KEYを入れる}" "https://infra-api.newrelic.com/v2/alerts/conditions/${5xx系の監視をしたいコンディションのid}" | jq .
curl -X PUT 'https://infra-api.newrelic.com/v2/alerts/conditions/${5xx系の監視をしたいコンディションのid}' -H 'X-Api-Key: ${API_KEYを入れる}' -i -H 'Content-Type: application/json' -d '{"data":{"select_value": "provider.httpCodeElb5XXCount.Sum"}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment