サービスレベル目標 API

Instana ( API )を使用して、主要なデータポイントを取得および設定できます。 とりわけ、この API は、サービスレベル目標(SLO)の変更に対する自動的な対応、特定されたインシデントの詳細な分析、およびレポート作成機能を実現します。

Instana API は、 OpenAPI v3 の形式で指定されます。 現在の仕様に関する詳細情報は、 GitHub API のドキュメントを参照してください。

認証と許可

以下の方法で認証および認可を行うことができます:

API 鍵の使用

Instana API は、 HTTP 認証リクエストヘッダー内の API キーを使用してリクエストを認証します。

例:以下の例では、 REST API と curl を使用して、利用可能なすべてのメトリクスと可能な集計を GET 呼び出しで取得します。

curl --request GET \
  --url https://instana.rocks/api/application-monitoring/catalog/metrics \
  --header 'authorization: apiToken xxxxxxxxxxxxxxxx'
 

API キーの取得方法

API キーを取得するには、以下の手順を完了してください:

  1. Instana UI にサインイン
  2. ナビゲーションサイドバーから、 [設定 ] > [セキュリティとアクセス] タブに移動します。 アクセス制御で、 [ API トークン] を選択し、[ 新しい API トークン ] をクリックします。
  3. 必須項目を入力し、必要な権限を有効にしてください。
  4. 保存 をクリックします。
注: SLO API へのアクセスには、「サービスレベル指標の設定」権限の承認が必要です。

Instana の Web セッション Cookie の使用

Instana UI にサインイン後、すべての Instana API にウェブブラウザから直接アクセスできます。 ブラウザのアドレス欄にエンドポイント URL を入力し、Enter キーを押します。 既存のサインイン済みユーザーセッションクッキーと共に、 Instana バックエンドへGETリクエストが送信される。

制限事項: ブラウザは直接GETリクエストのみ送信できるため、サードパーティ製拡張機能との連携によるサポートがない限り、その他の HTTP メソッドは利用できません。

SLO APIの権限要件

API トークンを使用してSLO( API )にアクセスするには、関連する API トークンに対する Configuration of service level indicators 権限が必要です。

SLO設定API

SLO設定( API )は、SLO設定を管理するためのものです。 SLO構成ペイロードは、 Instana のSLOエンティティの記述です。 Instana これらの設定を処理し、作成後にさまざまなメトリクスやレポートを生成します。 これらの設定は、 API を使用して更新および削除できます。 設定が削除されると、 Instana はその設定を処理しなくなり、関連するSLOアーティファクトにはアクセスできなくなります。 Instana API および Web インターフェースの動作は同期されています。

SLO構成ペイロード、アクション、およびエンドポイント

ペイロードは、SLO構成オブジェクトの JSON ボディコンテンツを表します。 GET、 POST、DELETE、およびPUTアクションは、SLO構成の取得、作成、削除、更新に使用されます。 これらの要素や相互作用に関する詳細については、 SLO 構成に関するドキュメント( API )を参照してください。

SLO設定の例

例1: アプリケーション時間ベースのレイテンシ

以下のSLOは、平均遅延が341ミリ秒未満であることを示す 96.3818 %のサービス品質を目標としています。エラー予算は、7日間のローリング時間窓において分単位で計算されます。 これはバックエンドアプリケーションの観点から測定されています。 このSLOはデフォルトでタイム UTC ゾーンに紐付けられています。

ペイロード:

{
  "name": "Cupcake Vending Machine performance aggregation over time",
  "target": 0.963818,
  "lastUpdated": 1690357470848,
  "entity": {
    "type": "application",
    "applicationId": "LsEOORPeR0Gnt_kntZbosw",
    "serviceId": null,
    "endpointId": null,
    "boundaryScope": "ALL",
    "includeInternal": false,
    "includeSynthetic": false,
    "tagFilterExpression": null
  },
  "indicator": {
    "type": "timeBased",
    "blueprint": "latency",
    "threshold": 341,
    "aggregation": "MEAN"
  },
  "timeWindow": {
    "type": "rolling",
    "duration": 7,
    "durationUnit": "day"
  },
  "tags": [
    "food",
    "snacks",
    "timeBased",
    "latency",
    "demo"
  ]
}
 
例2: ウェブサイトイベントベースの可用性

以下のSLOは、 HTTP リクエストビーコンの成功数とエラー数の比率によって示される、 71.38 %のサービス品質を目標としています。 エラー予算は、7日間のローリング時間窓において個々のイベントごとに計算される。 ユーザーの視点から測定されます。 このSLOはタイム America/New_York ゾーンを使用するように設定されています。

ペイロード:

{
  "name": "Cupcake Shop reliability by event count",
  "target": 0.7138,
  "lastUpdated": 1690357470042,
  "entity": {
    "type": "website",
    "websiteId": "h_TxI-AGSZqVd5tVKjDXKw",
    "beaconType": "httpRequest",
    "tagFilterExpression": null
  },
  "indicator": {
    "type": "eventBased",
    "blueprint": "availability",
    "threshold": 0
  },
  "timeWindow": {
    "type": "rolling",
    "duration": 7,
    "durationUnit": "day",
    "timezone": "America/New_York"
  },
  "tags": [
    "food",
    "snacks",
    "eventBased",
    "availability",
    "demo"
  ]
}
 

例3: イベントベースの可用性を合成テストする

以下のSLOは、合成テスト結果における非誤り結果と誤り結果の比率から算出される、 96.99 %のサービス品質を目標としています。 エラー予算は、7日間のローリング時間ウィンドウにおける個々のイベントに基づいて計算されます。 これはバックエンドアプリケーションの観点から測定されています。 デフォルトでは、このSLOはタイム UTC ゾーンに準拠しています。

ペイロード:

    {
      "name": "Cupcake Shop Synthetic Availability",
      "target": 0.9699,
      "lastUpdated": 1742587582774,
      "entity": {
        "type": "synthetic",
        "syntheticTestIds": [
          "lLW0jCW8mZRmdrEZ1cno"
        ],
        "tagFilterExpression": {
          "type": "EXPRESSION",
          "logicalOperator": "AND",
          "elements": []
        }
      },
      "indicator": {
        "type": "eventBased",
        "threshold": 0,
        "operator": null,
        "aggregation": null,
        "badEventsFilter": {
          "type": "TAG_FILTER",
          "name": "call.erroneous",
          "stringValue": null,
          "numberValue": null,
          "booleanValue": true,
          "floatValue": null,
          "key": null,
          "value": null,
          "operator": "EQUALS",
          "entity": "NOT_APPLICABLE"
        },
        "goodEventsFilter": {
          "type": "TAG_FILTER",
          "name": "call.erroneous",
          "stringValue": null,
          "numberValue": null,
          "booleanValue": false,
          "floatValue": null,
          "key": null,
          "value": null,
          "operator": "EQUALS",
          "entity": "NOT_APPLICABLE"
        },
        "blueprint": "availability"
      },
      "timeWindow": {
        "type": "rolling",
        "duration": 1,
        "durationUnit": "week"
      },
      "tags": []
    }
 

例4: タイムベースのトラフィックを合成するテスト

以下のSLOは、合成テスト結果の総トラフィック数に基づき、90%のサービス品質を目標としています。 誤差予算は、1日という固定時間枠において分単位で計算される。 時間窓内の全トラフィックの合計から測定されています。 SLOはタイム Europe/Dublin ゾーンに紐付けられています。

ペイロード:

    {
      "name": "Cupcake Shop Synthetic Traffic",
      "target": 0.9,
      "lastUpdated": 1736873398635,
      "entity": {
        "type": "synthetic",
        "syntheticTestIds": [
          "zOj9zRK2142Fjo6SNc4r",
          "0Ir0TqQzEECdc05jiHHu"
        ],
        "tagFilterExpression": {
          "type": "EXPRESSION",
          "logicalOperator": "AND",
          "elements": []
        }
      },
      "indicator": {
        "threshold": 1,
        "operator": ">=",
        "aggregation": "SUM",
        "trafficType": "all",
        "type": "timeBased",
        "blueprint": "traffic"
      },
      "timeWindow": {
        "type": "fixed",
        "duration": 1,
        "durationUnit": "day",
        "timezone": "Europe/Dublin",
        "startTimestamp": 1736830800000
      },
      "tags": []
    }
 
例 5:タグフィルターに基づくテスト選択を用いた合成テストの可用性

以下のSLOは、合成テスト結果における「誤りなし」と「誤りあり」の比率から算出される、99%のサービス品質を目標としています。 個々の合成テストIDを指定する代わりに、このSLOはタグフィルター式を使用して合成テストを動的に選択します。 この例では、名前が で始まる checkout すべての合成テストが SLO の計算に含まれます。 エラー許容値は、1日という固定の時間枠における個々のイベントに基づいて算出されます。 デフォルトでは、このSLOはタイム UTC ゾーンに合わせて設定されています。

ペイロード:

{
  "name": "Cupcake Shop Checkout Synthetic Availability",
  "target": 0.99,
  "lastUpdated": 1742587582774,
  "entity": {
    "type": "synthetic",
    "syntheticTestIds": null,
    "tagFilterExpression": {
      "key": null,
      "name": "synthetic.testName",
      "type": "TAG_FILTER",
      "value": "checkout",
      "entity": "NOT_APPLICABLE",
      "operator": "STARTS_WITH",
      "floatValue": null,
      "numberValue": null,
      "stringValue": "checkout",
      "booleanValue": null
    }
  },
  "indicator": {
    "type": "eventBased",
    "threshold": 0,
    "operator": null,
    "aggregation": null,
    "badEventsFilter": {
      "type": "TAG_FILTER",
      "name": "call.erroneous",
      "stringValue": null,
      "numberValue": null,
      "booleanValue": true,
      "floatValue": null,
      "key": null,
      "value": null,
      "operator": "EQUALS",
      "entity": "NOT_APPLICABLE"
    },
    "goodEventsFilter": {
      "type": "TAG_FILTER",
      "name": "call.erroneous",
      "stringValue": null,
      "numberValue": null,
      "booleanValue": false,
      "floatValue": null,
      "key": null,
      "value": null,
      "operator": "EQUALS",
      "entity": "NOT_APPLICABLE"
    },
    "blueprint": "availability"
  },
  "timeWindow": {
    "type": "fixed",
    "duration": 1,
    "durationUnit": "day"
  },
  "tags": []
}
 
例 6:タグフィルタに基づくテスト選択を用いた、時間ベースのトラフィックに対する合成テスト

以下のSLOは、合成テスト結果の総トラフィック数に基づき、95%のサービス品質を目標としています。 個々の合成テストIDを指定する代わりに、このSLOはタグフィルター式を使用して合成テストを動的に選択します。 この例では、ID が の場所から実行される合成 wfVYynQmKVY9LglFuC33 テストのみが SLO の計算に含まれます。 エラー許容値は、4週間という固定の期間において、分単位で算出されます。 この測定値は、指定された時間枠内のすべての合成トラフィックの合計に基づいています。 SLOはタイムゾーン America/New_York に紐付けられています。

ペイロード:

{
  "name": "Cupcake Shop New York Synthetic Traffic",
  "target": 0.95,
  "lastUpdated": 1736873398635,
  "entity": {
    "type": "synthetic",
    "syntheticTestIds": null,
    "tagFilterExpression": {
      "key": null,
      "name": "synthetic.locationId",
      "type": "TAG_FILTER",
      "value": "wfVYynQmKVY9LglFuC33",
      "entity": "NOT_APPLICABLE",
      "operator": "EQUALS",
      "floatValue": null,
      "numberValue": null,
      "stringValue": "wfVYynQmKVY9LglFuC33",
      "booleanValue": null
    }
  },
  "indicator": {
    "threshold": 1,
    "operator": ">=",
    "aggregation": "SUM",
    "trafficType": "all",
    "type": "timeBased",
    "blueprint": "traffic"
  },
  "timeWindow": {
    "type": "fixed",
    "duration": 4,
    "durationUnit": "week",
    "timezone": "America/New_York",
    "startTimestamp": 1736830800000
  },
  "tags": []
}
 

例 7: インフラストラクチャ・ホストの CPU 使用率の飽和(時間ベース)

以下のSLOは、本番環境ホストのCPU使用率を監視し、平均CPUシステム使用率が80%未満で99%の可用性を達成することを目標としています。 エラー予算は、7日間のローリングウィンドウで分単位で計算されます。 エラー予算は、ホストが健全なCPUレベルを維持することを支援するため、時間ベースのインジケーターを備えた飽和ブループリントを使用します。

ペイロード:

  {
  "name": "Production Host CPU Saturation",
  "target": 0.99,
  "entity": {
    "type": "infrastructure",
    "infraType": "host",
    "tagFilterExpression": {
      "type": "TAG_FILTER",
      "name": "host.name",
      "stringValue": "prod-web-01",
      "numberValue": null,
      "booleanValue": null,
      "floatValue": null,
      "key": null,
      "value": "prod-web-01",
      "operator": "EQUALS",
      "entity": "NOT_APPLICABLE"
    }
  },
  "indicator": {
    "type": "timeBased",
    "metricName": "cpu.sys",
    "threshold": 0.8,
    "operator": ">=",
    "aggregation": "MEAN",
    "blueprint": "saturation"
  },
  "timeWindow": {
    "type": "rolling",
    "duration": 7,
    "durationUnit": "day",
    "timezone": "UTC"
  },
  "tags": [
    "infrastructure",
    "host",
    "cpu",
    "saturation"
  ]
}
 

例 8: Kubernetes クラスタメモリの飽和(イベントベース)

以下のSLOは、イベントベースの指標を使用して Kubernetes クラスターのメモリ飽和状態を監視し、95%の可用性を目標としています。 メモリ比率が閾値未満の場合、イベントは良好と分類され、閾値以上である場合、不良と分類される。 エラー予算は、飽和ブループリントを用いて、30日間のローリングウィンドウで個々のイベントごとに計算される。

ペイロード:

 {
  "name": "K8s Cluster Memory Saturation",
  "target": 0.95,
  "entity": {
    "type": "infrastructure",
    "infraType": "kubernetesCluster",
    "tagFilterExpression": {
      "type": "TAG_FILTER",
      "name": "kubernetes.cluster.name",
      "stringValue": "production-cluster",
      "numberValue": null,
      "booleanValue": null,
      "floatValue": null,
      "key": null,
      "value": "production-cluster",
      "operator": "EQUALS",
      "entity": "NOT_APPLICABLE"
    }
  },
  "indicator": {
    "type": "eventBased",
    "metricName": "limitCapacityMemoryRatio",
    "threshold": 0.75,
    "operator": ">=",
    "aggregation": "MEAN",
    "blueprint": "saturation"
  },
  "timeWindow": {
    "type": "rolling",
    "duration": 30,
    "durationUnit": "day",
    "timezone": "UTC"
  },
  "tags": [
    "infrastructure",
    "kubernetes",
    "memory",
    "saturation"
  ]
}

例 9: AWS ECS コンテナのカスタムヘルスメトリクス(イベントベース)

以下のSLOは、カスタム指標に基づいて AWS ECS コンテナの健全性を監視するカスタムインジケーターを使用し、99%の可用性を目標としています。 イベントは、コンテナのCPU使用率が70%未満の場合に良好、この閾値を超えた場合に不良と分類される。 これは、カスタム指標が特定のビジネス要件に合わせたインフラ監視をサポートする柔軟性を示しています。

ペイロード:

 {
  "name": "ECS Container Custom Health",
  "target": 0.99,
  "entity": {
    "type": "infrastructure",
    "infraType": "awsEcsContainer",
    "tagFilterExpression": {
      "type": "TAG_FILTER",
      "name": "aws.ecs.cluster.name",
      "stringValue": "production-ecs-cluster",
      "numberValue": null,
      "booleanValue": null,
      "floatValue": null,
      "key": null,
      "value": "production-ecs-cluster",
      "operator": "EQUALS",
      "entity": "NOT_APPLICABLE"
    }
  },
  "indicator": {
    "type": "eventBased",
    "goodEventsFilter": {
      "type": "TAG_FILTER",
      "name": "cpu.usage",
      "stringValue": null,
      "numberValue": 0,
      "booleanValue": null,
      "floatValue": 0.7,
      "key": null,
      "value": 0.7,
      "operator": "LESS_THAN",
      "entity": "NOT_APPLICABLE"
    },
    "badEventsFilter": {
      "type": "TAG_FILTER",
      "name": "cpu.usage",
      "stringValue": null,
      "numberValue": 0,
      "booleanValue": null,
      "floatValue": 0.7,
      "key": null,
      "value": 0.7,
      "operator": "GREATER_OR_EQUAL_THAN",
      "entity": "NOT_APPLICABLE"
    },
    "goodEventInfraMetric": "cpu.usage",
    "badEventInfraMetric": "cpu.usage",
    "blueprint": "custom",
    "operator": null,
    "threshold": 0,
    "aggregation": "MEAN"
  },
  "timeWindow": {
    "type": "rolling",
    "duration": 1,
    "durationUnit": "week",
    "timezone": "America/New_York"
  },
  "tags": [
    "infrastructure",
    "aws",
    "ecs",
    "custom"
  ]
}

例10:暦月単位の時間枠におけるアプリケーションの遅延

以下のSLOは、平均遅延が200ミリ秒未満であることを示すサービス品質99%を目標としています。エラー予算は、固定された暦月単位の時間枠において分単位で計算されます。 これはバックエンドアプリケーションの観点から測定されます。 このSLOはアメリカ/ニューヨークのタイムゾーンに紐付けられています。 カレンダー月単位の時間枠は固定時間枠でのみサポートされ、1か月の期間に限定されます。 月の中旬に作成された場合、初期の測定期間は作成日からその月の最終日までとなり、以降の期間は完全な暦月に従います。

ペイロード:

{
  "name": "Payment Service Monthly Latency",
  "target": 0.99,
  "lastUpdated": 1737561600000,
  "entity": {
    "type": "application",
    "applicationId": "PaymentApp123456",
    "serviceId": null,
    "endpointId": null,
    "boundaryScope": "INBOUND",
    "includeInternal": false,
    "includeSynthetic": false,
    "tagFilterExpression": null
  },
  "indicator": {
    "type": "timeBased",
    "blueprint": "latency",
    "threshold": 200,
    "aggregation": "MEAN"
  },
  "timeWindow": {
    "type": "fixed",
    "duration": 1,
    "durationUnit": "calendar_month",
    "timezone": "America/New_York",
    "startTimestamp": 1737561600000
  },
  "tags": [
    "payment",
    "production",
    "monthly",
    "latency"
  ]
}

例 11: モバイルアプリ「 HTTP 」のレイテンシ(イベントベース)

以下のSLOは、 HTTP のカートサービスにアクセスするAndroid端末のリクエスト遅延を監視し、99%の可用性を目標としています。 SLOでは、レイテンシが200ミリ秒未満の場合は「良好」、この閾値を超える場合は「不良」と分類されます。 エラーバジェットは、1日という固定の期間において、個々の HTTP リクエストビーコンごとに計算されます。

ペイロード:

{
  "name": "Mobile App Cart Service Latency - Android",
  "target": 0.99,
  "entity": {
    "type": "mobile",
    "mobileIds": [],
    "tagFilterExpression": {
      "type": "TAG_FILTER",
      "name": "mobileBeacon.platform",
      "stringValue": "Android",
      "numberValue": null,
      "booleanValue": null,
      "floatValue": null,
      "key": null,
      "value": "Android",
      "operator": "EQUALS",
      "entity": "NOT_APPLICABLE"
    }
  },
  "indicator": {
    "type": "eventBased",
    "threshold": 200,
    "operator": ">",
    "aggregation": "MEAN",
    "metric": {
      "name": "httpLatency",
      "scope": {
        "type": "httpRequest",
        "tagFilterExpression": {
          "type": "TAG_FILTER",
          "name": "mobileBeacon.http.url",
          "stringValue": "https://rs-cart/add-cart",
          "numberValue": null,
          "booleanValue": null,
          "floatValue": null,
          "key": null,
          "value": "https://rs-cart/add-cart",
          "operator": "EQUALS",
          "entity": "NOT_APPLICABLE"
        }
      }
    },
    "blueprint": "latency"
  },
  "timeWindow": {
    "type": "fixed",
    "duration": 1,
    "durationUnit": "day",
    "timezone": "UTC",
    "startTimestamp": 1782082800000
  },
  "tags": [
    "mobile",
    "android",
    "latency",
    "cart"
  ]
}

例 12:モバイルアプリのクラッシュの影響を受けたセッション(時間ベース)

以下のSLOは、小売向けモバイルアプリのクラッシュによるセッション数を監視し、99%の可用性を目標としています。 エラー許容値は、固定された暦月の期間において、分単位で算出されます。 SLOでは、クラッシュの影響を受けたセッション数が15を超えた場合、その分間を「不良」と分類します。

ペイロード:

{
  "name": "Retail Mobile App - Crash Affected Sessions",
  "target": 0.99,
  "entity": {
    "type": "mobile",
    "mobileIds": [
      "i1IsNS7FQAegEljBTkNBMQ"
    ],
    "tagFilterExpression": {
      "type": "EXPRESSION",
      "logicalOperator": "AND",
      "elements": []
    }
  },
  "indicator": {
    "type": "timeBased",
    "threshold": 15,
    "operator": ">",
    "aggregation": "SUM",
    "metric": {
      "name": "crashAffectedSessionCount",
      "scope": {
        "type": "crash",
        "tagFilterExpression": {
          "type": "EXPRESSION",
          "logicalOperator": "AND",
          "elements": []
        }
      }
    },
    "blueprint": "availability"
  },
  "timeWindow": {
    "type": "fixed",
    "duration": 1,
    "durationUnit": "calendar_month",
    "timezone": "Europe/Dublin",
    "startTimestamp": 1781564400000
  },
  "tags": [
    "mobile",
    "crash",
    "availability"
  ]
}

例 13: モバイルアプリのカスタムブループリント( HTTP のレイテンシとビュー遷移)

以下のサービスレベル目標(SLO)では、カスタム指標を使用してモバイルアプリのユーザー体験を監視します。 このインジケーターは、 HTTP の高速な応答とスムーズな表示切り替えを組み合わせることで、99%の可用性を目指しています。 「良好なイベント」とは、レイテンシが 500 ms 未満の HTTP リクエストを指します。「不良なイベント」とは、処理時間が 300 ms を超えるビューの変更を指します。この SLO では、カスタムブループリントを使用して、さまざまなビーコンタイプにわたって監視を行う方法について説明します。

ペイロード:

{
  "name": "E-commerce Mobile App - User Experience",
  "target": 0.99,
  "entity": {
    "type": "mobile",
    "mobileIds": [
      "PwozCjutQEuJjQT01ktwOw",
      "i1IsNS7FQAegEljBTkNBMQ"
    ],
    "tagFilterExpression": {
      "type": "EXPRESSION",
      "logicalOperator": "AND",
      "elements": []
    }
  },
  "indicator": {
    "type": "eventBased",
    "goodEvents": {
      "aggregation": "SUM",
      "threshold": 500,
      "operator": "<",
      "metric": {
        "name": "httpLatency",
        "scope": {
          "type": "httpRequest",
          "tagFilterExpression": {
            "type": "EXPRESSION",
            "logicalOperator": "AND",
            "elements": []
          }
        }
      }
    },
    "badEvents": {
      "aggregation": "SUM",
      "threshold": 300,
      "operator": ">",
      "metric": {
        "name": "viewChangeDuration",
        "scope": {
          "type": "viewChange",
          "tagFilterExpression": {
            "type": "EXPRESSION",
            "logicalOperator": "AND",
            "elements": []
          }
        }
      }
    },
    "blueprint": "advanced-custom",
    "operator": null,
    "threshold": 0,
    "aggregation": "MEAN"
  },
  "timeWindow": {
    "type": "fixed",
    "duration": 1,
    "durationUnit": "calendar_month",
    "timezone": "UTC",
    "startTimestamp": 1782082800000
  },
  "tags": [
    "mobile",
    "custom",
    "user-experience"
  ]
}

SLO構成の作成/取得/更新/削除を行う基本API

以下の基本APIは、UI操作なしでSLO設定の作成、取得、更新、削除を実行できます。 API 文書は、以下のURLで閲覧できます。 Instana GitHub

SLOの設定を作成する

この API 呼び出しは、コマンドに含まれる JSON ペイロードに基づいて、一意の新しいSLO構成を作成します。

curl 例:

echo -e ' \
{
  "name": "my SLO no 1",
  "target": 0.96,
  "lastUpdated": 1690357470848,
  "entity": {
    "type": "application",
    "applicationId": "LsEOORPeR0Gnt_kntZbosw",
    "serviceId": null,
    "endpointId": null,
    "boundaryScope": "ALL",
    "includeInternal": false,
    "includeSynthetic": false,
    "tagFilterExpression": null
  },
  "indicator": {
    "type": "timeBased",
    "blueprint": "latency",
    "threshold": 341,
    "aggregation": "MEAN"
  },
  "timeWindow": {
    "type": "rolling",
    "duration": 7,
    "durationUnit": "day",
    "timezone": "America/Chicago"
  },
  "tags": [
    "food",
    "snacks",
    "timeBased",
    "latency",
    "demo"
  ]
}
' | curl -X POST -H "Content-Type: application/json" -H 'authorization: apiToken XXXXXXXXXXXXXX' https://instana.rocks/api/settings/slo -d @-
 
ID による SLO 設定の取得

この API 呼び出しは、一意のSLO構成とその主要な属性ペアを返します。 特定の構成におけるID属性の知識が必要です。

curl 例:

curl -H 'authorization: apiToken XXXXXXXXXXXXXX' https://instana.rocks/api/settings/slo/SLOsmbQLI8ORcuhF_L-QquFWQ
 
既存のSLO設定を更新する

既存のSLO構成において UPDATE、更新が許可されている属性のみを更新します。 特定の構成におけるID属性の知識が必要です。

以下のフィールドは更新可能です(その他のフィールドは更新不可です):

  • 名前
  • ターゲット
  • timeWindow.type
  • timeWindow.duration
  • timeWindow.durationUnit
  • timeWindow.timezone
  • タグ

curl 例:

echo -e ' \
{
      "name": "My SLO no1 updated",
      "target": 90.1,
      "entity": {
        "type": "application",
        "applicationId": "6uWKK5izTFqo0bdioIr1PA",
        "serviceId": null,
        "endpointId": null,
        "boundaryScope": "ALL",
        "includeInternal": false,
        "includeSynthetic": false,
        "tagFilterExpression": {
          "type": "EXPRESSION",
          "logicalOperator": "AND",
          "elements": []
        }
      },
      "indicator": {
        "type": "timeBased",
        "threshold": 1234,
        "aggregation": "P95",
        "blueprint": "latency"
      },
      "timeWindow": {
        "type": "fixed",
        "duration": 1,
        "durationType": "day",
        "timezone": "Europe/Berlin",
        "startTimestamp": 1681311907374
      },
        "tags": ["tagA", "tagB"]
 }
' | curl -X PUT -H "Content-Type: application/json" -H 'authorization: apiToken XXXXXXXXXXXXXX' https://instana.rocks/api/settings/slo/SLOsmbQLI8ORcuhF_L-QquFWQ
 
すべてのSLO設定を取得する

この API 呼び出しは、すべてのSLO構成と、それぞれのキー属性ペアを返します。

curl 例:

curl -H 'authorization: apiToken XXXXXXXXXXXXXX' https://instana.rocks/api/settings/slo
 
SLO設定のタグを取得

この API 呼び出しは、存在するすべてのSLO構成タグを返します。

curl 例:

curl -H 'authorization: apiToken XXXXXXXXXXXXXX' https://instana.rocks/api/settings/slo/tags
 
SLO設定を削除

この API 呼び出しは、そのIDによって一意に識別される既存のSLO構成を削除します。

curl 例:

curl -X DELETE -H 'authorization: apiToken XXXXXXXXXXXXXX' https://instana.rocks/api/settings/slo/SLOsmbQLI8ORcuhF_L-QquFWQ

 

サービスレベルレポート API

SLOレポート( REST API )は、指定された設定IDと時間範囲に基づいて、すべてのメトリクスとグラフを1つのレスポンスで返します。

以下は、SLOレポート( API )を使用して、2025年3月31日 13:00 から 16:00 までのレポートを取得する例です:

curl 例:

curl -H 'authorization: apiToken XXXXXXXXXXXXXX' https://instana.rocks/api/slo/report/SLO99DvvwekR3G0VDw-1m2KtA?to=1743451200000&from=1743444000000
 

応答の例:

{
  "sli": 0.9895833333333334,
  "slo": 0.99,
  "totalErrorBudget": 14,
  "errorBudgetRemaining": -1,
  "errorBudgetSpent": 15,
  "errorBurnRate": 1,
  "fromTimestamp": 1743444000000,
  "toTimestamp": 1743451200000,
  "violationDistribution": {
    "0": 1,
    "1": 1,
    "2": 1
  },
  "errorChart": {
    "0": 0,
    "1": 0,
    "2": 0
  },
  "errorAccumulationChart": {
    "0": 7,
    "1": 7,
    "2": 7
  },
  "errorBudgetRemainChart": {
    "0": 7,
    "1": 7,
    "2": 7
  },
  "errorBurnRateChart": {
    "0": 0,
    "1": 0,
    "2": 0
  }
}
}
 

SLOスマートアラート API

SLOスマートアラートは、サービスレベルアラート設定API を使用して管理できます。 他のSmart Alert APIと同様に、このAPI群はSLOアラートの読み取り、作成、更新、削除、有効化、無効化、バージョン管理、および改訂が可能です。

SLOエラー予算の消費を監視するスマートアラートの作成例を以下に示します:

  • 要求:
echo -e ' \
{
  "alertChannelIds": [],
  "customPayloadFields": [],
  "description": "Consumed >= 80% of the error budget.",
  "name": "Remaining error budget is low",
  "rule": {
    "alertType": "ERROR_BUDGET",
    "metric": "BURNED_PERCENTAGE"
  },
  "severity": 5,
  "sloIds": [
    "SLO2XfFi3h7TiWk56MRbyiAOA",
    "SLOlVgz62GhQO6x0I-qUJnwZg"
  ],
  "threshold": {
    "type": "staticThreshold",
    "value": 0.8,
    "operator": ">=",
    "lastUpdated": 1743534460472
  },
  "timeThreshold": {
    "expiry": 300000,
    "timeWindow": 900000
  },
  "triggering": true
}
' | curl -X PUT -H "Content-Type: application/json" -H 'authorization: apiToken XXXXXXXXXXXXXX' https://instana.rocks/api/events/settings/global-alert-configs/service-levels
 
  • 回答:
{
    "name": "Remaining error budget is low",
    "description": "Consumed >= 80% of the error budget.",
    "severity": 5,
    "burnRateTimeWindows": null,
    "triggering": true,
    "rule": {
        "alertType": "ERROR_BUDGET",
        "metric": "BURNED_PERCENTAGE"
    },
    "threshold": {
        "type": "staticThreshold",
        "operator": ">=",
        "value": 0.8,
        "lastUpdated": 1743534460472
    },
    "sloIds": [
        "SLO2XfFi3h7TiWk56MRbyiAOA",
        "SLOlVgz62GhQO6x0I-qUJnwZg"
    ],
    "alertChannelIds": [],
    "timeThreshold": {
        "expiry": 300000,
        "timeWindow": 900000
    },
    "customPayloadFields": [],
    "id": "o-xuzP6yT1u5UZNthAx6Rg",
    "created": 1743534461234,
    "initialCreated": 1743534461234,
    "readOnly": false,
    "enabled": true
}
 

レガシーライト SLO API

API を通じてレガシー およびライト SLI を管理する

レガシー およびライト SLOは、先行するSLOとは異なる方法で実装されました。 サービスレベルインジケーター(SLI)は、必須の設定項目です。 SLOは、ビジネス要件に応じてサービスレベルの結果を表示するためのカスタムダッシュボード設定の一部です。

  • SLI 構成 ` API ` は、 レガシー および Lite SLI 構成に対して、SLI 構成の作成、読み取り、更新、削除を行うためのエンドポイントを提供します。
  • カスタムダッシュボード API は、カスタムダッシュボードとSLOウィジェットの管理に使用されます。

例として、以下の curl コマンドを使用すると、IDが appIdMy First SLI アプリケーションに対して、IDが のサービスを持ち、エンドポイントID serviceId が に等しい呼び出しに限定 endpointIdされた、時間ベースのSLIを作成できます。 SLIは、メトリ latency ックの90パーセンタイル値と閾値に対して集計される 25 ms

curl --location --request POST "{{base}}/api/settings/v2/sli" \
  --header "Authorization: apiToken {{apiToken}}" \
  --header "Content-Type: application/json" \
  --data '{
    "sliName": "My first SLI",
    "metricConfiguration": {
        "metricName": "latency",
        "metricAggregation": "P90",
        "threshold": 25
    },
    "sliEntity": {
        "sliType": "application",
        "applicationId": "appId",
        "serviceId": "serviceId",
        "endpointId": "endpointId",
        "boundaryScope": "ALL"
    }
  }'
 

レガシー およびライト SLIレポート API

SLOレポートと同様に( API )、 SLIレポートを呼び出してSLI Lite レポート Legacy を取得できます。 SLOレポート( API )とは異なり、リクエストにはSLO目標値を指定する必要があります。

以下に例を示します。

  • 要求
https://instana.rocks/api/sli/report/Ca_h3OGvT3iu5Kt6LVsJ7g?slo=0.9&to=1743451200000&from=1743444000000
 
  • 応答
{
  "sli": 0.9166666666666666,
  "slo": 0.9,
  "totalErrorBudget": 12,
  "errorBudgetRemaining": 2,
  "fromTimestamp": 1743444000000,
  "toTimestamp": 1743451200000,
  "violationDistribution": {
    "0": 1,
    "1": 1,
    "2": 1,
    "3": 1,
    "4": 1,
    "5": 1,
    "6": 1,
 ... ...
    "99": 1,
    "100": 0
  }
}