Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Instana外形監視テスト結果取得

Avatar for Jacky Xu Jacky Xu
August 08, 2023

 Instana外形監視テスト結果取得

Instana Open API を利用して、外形監視テスト結果の取得を実装しています。

Avatar for Jacky Xu

Jacky Xu

August 08, 2023
Tweet

Other Decks in Technology

Transcript

  1. テスト結果のExport例 1.外形監視テスト一覧を取得: 利用されるAPI:Get {{ base_url }}/api/synthetics/settings/tests curl --request GET \

    --url https://sesandbox-instana.instana.io/api/events/settings/event-specifications/custom \ --header 'authorization: apiToken cO5EU540RKy4DhHsxi7hxQ’ PS: 1) apiTokenはUI画面の「設定→チーム設定→APIトークン」から「Access to Synthetic test results」権限 を持つTokenを作成できます。 2) 出力した一覧からテストの名前にて"id”を見つける。例: { "id": "zu1x0tfve1VaDffTIF3s", "tenantId": "saas_instanaibm_xxxxx", "label": "0803kawano_api", "description": "", "active": true, ….. } user1@MacBook-Air % curl --request GET \ --url https://xxxxx-instanaibm.instana.io/api/synthetics/settings/tests \ --header 'authorization: apiToken ngOY-96VSBS33dbyvWrp0A'
  2. 特定の外形監視のテスト結果を取得する: 利用されるAPI: POST {{ base_url }}/api/synthetics/results/list user1@MacBook-Air %curl --request POST

    \ --url https://xxxxx-instanaibm.instana.io/api/synthetics/results/list \ --header 'Content-Type: application/json' \ --header 'authorization: apiToken ngOY-96VSBS33dbyvWrp0A ' \ --data '{ "syntheticMetrics":["synthetic.metricsResponseTime","synthetic.metricsResponseSize"], "order":{ "by":"synthetic.metricsResponseTime", "direction":"DESC" }, "tagFilters":[{ "stringValue":" zu1x0tfve1VaDffTIF3s ", "name":"synthetic.testId", "operator":"EQUALS" }], "timeFrame": { "to": 0, "windowSize": 1800000 } }'