月に 100GB までですが、無料プランで New Relic の全ての機能が試せるなんて、クラウドエンジニアとしては嬉しい限りです。
API Key を取得
こちらのドキュメントを参考に、API Key を取得します。
https://docs.newrelic.com/jp/docs/apis/intro-apis/new-relic-api-keys/
Synthetics API を実行
こちらのドキュメントを参考に、API を実行します。
bash だと下記のような内容になります。
# 環境変数をセットします
API_ENDPOINT=https://synthetics.newrelic.com/synthetics/api
API_KEY=NRAK-********************
# Synthetics に外形監視を登録します
curl $API_ENDPOINT/v3/monitors \
-X POST \
-H "Api-Key:$API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name":"wp.mnrst.com",
"frequency":15,
"uri":"https://test.mnrst.com/readme.html?&preview=true",
"locations":[
"AWS_AP_NORTHEAST_1",
"AWS_EU_WEST_2",
"AWS_US_WEST_1"
],
"type":"simple",
"status":"enabled",
"slaThreshold":7
}'
# Synthetics の設定一覧を取得します
curl $API_ENDPOINT/v3/monitors \
-H "Api-Key:$API_KEY"
外形監視を実行している状態

参考
https://blog.mnrst.com/2023/02/new-relic-synthetic-monitoring.html
タグ: New Relic