次の方法で共有


Azure portal を使用して Azure SQL Managed Instance のアラートを作成する

Applies to:Azure SQL Managed Instance

この記事では、Azure portal を使用して、Azure SQL Managed Instance のデータベースのアラートを設定する方法について説明します。 この記事では、アラート ルールを設定するベスト プラクティスも紹介します。

新しいメトリック アラートを設定する

監視メトリック、イベント、Azure サービスに基づいて通知を受け取ることができます。 For more information, see Metric alerts.

  • Metric values - The alert triggers when the value of a specified metric crosses a threshold you assign.
  • アクティビティ ログ イベント - アラートは、" すべて " のイベントに対して、または特定数のイベントが発生したときにのみトリガーされます。
  • Resource health - An alert related to the resource health status events, including whether the event was platform or user-initiated.
  • Log search - Log Analytics searches on captured log data, including custom log searches or prepared sample queries.

アラートがトリガーされたときに実行されるように構成できる処理は次のとおりです。

  • サービスの管理者および共同管理者に電子メール通知を送信する
  • 指定した追加のメール (Azure Resource Manager ロールを含む) にメールを送信します。
  • 音声ガイドに従って電話をかける
  • 電話番号にテキスト メッセージを送信する
  • Azure mobile app の通知を送信する
  • Automation Runbook を開始する
  • Azure 関数を呼び出す
  • Event Hubs アクションを開始する
  • ITSM 互換チケットを作成する
  • ロジック アプリのアクションを選択する
  • Webhook またはセキュリティで保護された Webhook を呼び出す

アラート ルールを構成したり、その情報を取得したりするには、以下を使用します。

Azure SQL Managed Instance で使用可能なアラート メトリック

Important

アラート メトリックは、SQL Managed Instance でのみ使用できます。 SQL Managed Instance 内の個々のデータベースのアラート メトリックは使用できません。 Database diagnostics telemetry is on the other hand available in the form of diagnostics logs. Alerts on diagnostics logs can be setup from within SQL Analytics product using log alert scripts for managed instance.

アラート構成には、次の SQL Managed Instance メトリックを使用できます。

Metric Description 計測単位または指定できる値
平均 CPU の割合 選択された期間の平均 CPU 使用率。 0-100 (percent)
読み取り IO バイト 選択された期間に読み取られた IO バイト。 Bytes
書き込み IO バイト 選択された期間に書き込まれた IO バイト。 Bytes
IO 要求数 選択された期間の IO 要求の数。 Numerical
予約済みストレージ スペース マネージド インスタンス用に予約されている現在の最大ストレージ スペース。 リソースのスケーリング操作による変更。 MB (Megabytes)
使用済みストレージ スペース 選択された期間に使用されたストレージ スペース。 データベースとインスタンスでのストレージ消費による変更。 MB (Megabytes)
仮想コア数 マネージド インスタンス用にプロビジョニングされた仮想コア。 リソースのスケーリング操作による変更。 4-80 (vCores)

Azure ポータルでメトリックにアラート ルールを作成する

  1. In the Azure portal, locate the managed instance you are interested in monitoring, and select it.

  2. Select Metrics menu item in the Monitoring section.

  3. On the Metric dropdown, select one of the metrics you wish to set up your alert on (Storage space used is shown in the example).

  4. Use Aggregation to select the aggregation period - average, minimum, or maximum reached in the given time period (Avg, Min, or Max).

  5. [新しいアラート ルール] を選択します。

    [使用済みの記憶域] メトリックが選択されている Azure portal のメトリック エクスプローラーのスクリーンショット。

  6. In the Alert logic section:

    Field Description
    Threshold 静的な値または動的な値のどちらに基づいてしきい値を評価する必要があるかを選択します。
    静的しきい値は、構成したしきい値を使用してルールを評価します。
    動的しきい値は、機械学習アルゴリズムを使用して、メトリックの動作パターンを継続的に学習し、しきい値を自動的に計算します。 メトリック アラートに対する動的しきい値の使用に関する詳細についてご確認ください。
    Aggregation type 集計の種類のオプションは、最小、最大または平均 (集計粒度期間内) です
    Operator メトリックの値をしきい値と比較するための演算子を選択します。
    Unit If the selected metric signal supports different units, such as bytes, KB, MB, and GB, and if you selected a static threshold, enter the unit for the condition logic.
    Threshold value If you selected a static threshold, enter the threshold value for the condition logic. しきい値は、演算子と集計の条件に基づいて評価される、アラート値です。
    Threshold sensitivity If you selected a dynamic threshold, enter the sensitivity level. 感度レベルは、アラートをトリガーするために必要なメトリック系列パターンからの偏差の量に影響します。
    Aggregation granularity 集計型関数を使ってデータ ポイントをグループ化するために使われる間隔を選びます。 Choose an Aggregation granularity (Period) that's greater than the Frequency of evaluation to reduce the likelihood of missing the first evaluation period of an added time series.
    評価の頻度 アラート ルールの実行頻度を選びます。 評価のスライディング ウィンドウを生成するため、集計の粒度より小さい頻度を選びます。
  7. [評価するタイミング] セクションで:

    Field Description
    Check every 条件が満たされているかどうかアラート ルールを調べる頻度を選択します。
    Lookback period ルックバック期間を選択します。これは、データをチェックするたびに振り返る期間です。 たとえば、1 分ごとに過去 5 分間を調べます。

    スクリーンショットに示されている例では、1,840,876 MB の値が使用されており、しきい値が 1.8 TB であることを表しています。 この例の演算子はより大きいに設定されているため、SQL Managed Instance のストレージ スペース消費量が 1.8 TB を超える場合は、アラートがトリガーされます。 ストレージ スペース メトリックのしきい値は MB で表す必要があります。

    Azure portal の [アラート ルールを作成する] ダイアログ ボックスの [条件] タブのスクリーンショット。[アラート ロジック] と [評価するタイミング] セクションが強調されています。

  8. ページの下部にある [次へ: アクション >] または [アクション] タブを選択します。

  9. In the Actions tab, select or create the required action group. このアクションでは、アラートをトリガーしたときに行うこと (メールを送る、電話をかけるなど) を定義します。 Select an existing Action group from the Select action groups pane, or Create action group in your subscription.

    1. [+ アクション グループの作成] を選びます。

      Azure portal の [アラート ルールを作成する] ダイアログ ボックスの [アクション] タブのスクリーンショット。[アクション グループの作成] ボタンが強調されています。

    2. [アクション グループ名][表示名] を入力し、[リージョン] を選択します。

      Option Behavior
      Global アクション グループ サービスは、アクション グループを格納する場所を決定します。 リージョンの回復性を確保するために、アクション グループは少なくとも 2 つのリージョンに保持されます。 Processing of actions might be done in any geographic region.

      サービス正常性アラートの結果として実行される音声、SMS、電子メールのアクションは、Azure のライブ サイト インシデントに対して回復性があります。
      Regional アクション グループは、選択したリージョン内に格納されます。 The action group is zone-redundant. アクションの処理は、リージョン内で実行されます。

      Use this option if you want to ensure that the processing of your action group is performed within a specific geographic boundary.

      Azure portal の [アクション グループを作成する] ダイアログ ボックスの [基本] タブのスクリーンショット。

    3. Select Next:Notifications> at the bottom of the page or the Notifications tab.

    4. In the Notifications tab, define a notification to send when the alert is triggered.

      • Notification type: Select Email Azure Resource Manager Role to send an email to users who are assigned to certain subscription-level Azure Resource Manager roles or Email/SMS message/Push/Voice to send various notification types to specific recipients.

      • Name: Enter a unique name for the notification.

      • Details: Based on the selected notification type, enter an email address, phone number, or other information.

      • 共通アラート スキーマ: 共通アラート スキーマを有効にすると、Monitor のすべてのアラート サービスにわたって 1 つの拡張可能で統一されたアラート ペイロードを持つという利点を提供します。 このスキーマの詳細については、「共通アラート スキーマ」を参照してください。

      [アクション グループの作成] ダイアログ ボックスの [通知] タブのスクリーンショット。電子メール通知の構成情報が表示されている。

    5. If you need to define a list of actions to trigger when an alert is triggered, select the Actions tab and define the actions.

      [アクションの種類] フィールドと [名前] フィールドが強調されている、Azure portal の [アクション グループを作成する] ダイアログ ボックスの [アクション] タブのスクリーンショット。

    6. If you'd like to assign a key-value pair to the action group, select the Tags tab. Otherwise, skip this step. タグを使用すると、Azure リソースを分類できます。 タグは、すべての Azure リソース、リソース グループ、サブスクリプションで使用できます。

      Azure portal の [アクション グループを作成する] ダイアログ ボックスの [タグ] タブのスクリーンショット。[名前] と [値] ボックスに値が表示されています。

    7. 設定を確認するには、[確認と作成] タブを選択します。このステップでは、入力を簡単に調べて、必要なすべての情報を入力したことを確認します。 問題がある場合は、ここで報告されます。 After you've reviewed the settings, select Create to create the action group.

      [作成] ボタンが強調されている、Azure portal の [アクション グループを作成する] ダイアログ ボックスの [確認と作成] タブのスクリーンショット。

  10. In the Details tab, fill in the alert rule details and settings for your records and select the severity type. You also have the option to use the Custom properties to add your own properties to the alert rule.

    Azure portal の [アラートの作成] ダイアログ ボックスの [詳細] タブのスクリーンショット。

  11. In the Tags tab, set any required tags on the alert rule resource. それ以外の場合、この手順はスキップしてください。

    Azure portal の [アラート ルールを作成する] ダイアログ ボックスの [タグ] タブのスクリーンショット。[名前] と [値] ボックスに値が表示されています。

  12. [確認と作成] タブで検証が実行され、問題がある場合は通知されます。 When validation passes and you've reviewed the settings, select the Create button at the bottom of the page.

    Azure portal の [アラート ルールを作成する] ダイアログ ボックスの [確認と作成] タブのスクリーンショット。[作成] ボタンが強調されています。

新しいアラート ルールは数分以内にアクティブになり、設定に基づいてトリガーされるようになります。

Azure portal で追加のアラート ルールを作成する

SQL Managed Instance のアクティビティ ログ イベントリソース正常性ログ検索に関するアラート ルールを作成することもできます。

詳細については、以下を参照してください:

  1. In the Azure portal, locate the resource you are interested in monitoring and select it.
  2. In the resource menu under Monitoring, select Alerts. テキストとアイコンは、リソースごとに多少異なる場合があります。
  3. Select the + Create button, then Alert rule.
  4. [アラート ルールの作成] ページで、スコープがリソースに対して自動的に構成されます。

    Note

    多数の独立したアラートが発生しないように、サブスクリプション、リソース グループ、または Azure SQL データベース論理サーバー内の種類のすべてのリソースに対してアラートを構成できます。 Use the Scope tab to change the scope of the new alert rule.

In Azure SQL Managed Instance, capture events and configure alerts for resource service health in the Resource health signal category.

  1. On the Conditions pane, select See all signals.

  2. [シグナルの選択] ウィンドウで、[リソース正常性] を選択します。 Select Apply.

  3. The Event status, Current resource status, Previous resource status, and Resource type dropdowns provide options to configure alerts for many possible resource health status changes. 既定では、考えられるすべての状態と状態の変更が選択されるため、サービス正常性の問題の検出と解決に関するアラートを送信できます。

    Field Description
    Event status Resource Health イベントの状態を選びます。 Values are Active, In Progress, Resolved, and Updated.
    現在のリソースの状態 現在のリソースの状態を選びます。 Values are Available, Degraded, and Unavailable.
    以前のリソースの状態 以前のリソースの状態を選びます。 Values are Available, Degraded, Unavailable, and Unknown.
    Reason type Resource Health イベントの原因を選択します。 Values are Platform Initiated, Unknown, and User Initiated.
  4. [次へ: アクション]> を選択します。

  1. Select an existing Action group from the Select action groups pane, or Create action group in your subscription. アクション グループを使用して、アラート条件が発生したときに実行するアクションを定義できます。 このアクションでは、アラートをトリガーしたときに行うこと (メールを送るなど) を定義します。
    1. または、クイック アクションの使用機能を使用して新しいアクション グループを作成し、メールまたは Azure mobile app 通知ターゲットを指定します。
  2. [Next: Details](次へ: 詳細)> を選択します。
  3. Provide a Subscription and Resource group.
  4. 既定では、アラート ルールの重大度は 3 - 情報提供です。 You can adjust the alert rule's Severity as desired.
  5. アラート ルール名を指定します。 省略できますが、説明を入力することをお勧めします。
  6. Provide a Region for the alert rule.
  7. Choose an Identity for the alert rule. アラート ルールでシステム割り当てマネージド ID (SAMI)、ユーザー割り当てマネージド ID (UAMI) を使用するように選択できます。 For more information, see Identity.
  8. Under Advanced options:
    1. アラート ルールの作成が完了したらすぐにその実行が開始されるように、必ず [作成時に有効化] を選択します。
    2. [アラートの自動解決] オプションは、既定で有効になっています。 これにより、アラートがステートフルになります。つまり、条件が満たされなくなった場合にアラートが解決されます。
  9. タグ>を選択します。
  10. Azure タグの使用を検討します。 たとえば、リソースを作成したユーザーを識別する "Owner" または "CreatedBy" タグ、このリソースが運用や開発などの環境にあるかどうかを識別する "Environment" タグなどです。詳細については、「Azure リソースの名前付けおよびタグ付けの戦略を作成する」を参照してください。
  11. [Review + create](レビュー + 作成) を選択します。
  12. Select Create. 間もなく、アラートがアクティブになります。

Verify alerts

Note

わずらわしいアラートを表示しないようにする場合は、アクション ルールを使用したアラートの非表示に関する記述を参照してください。

アラート ルールを設定するときに、アラート トリガーとその頻度に問題がないことを確認します。 使用済みのストレージ スペースに関するアラートを設定するためにこのページに示されている例では、アラート オプションがメールの場合、次のようなメールを受け取る可能性があります。

アラートがトリガーされたときに送られるメールの例のスクリーンショット。

メールでは、アラートの名前、しきい値の詳細、アラートがトリガーされた理由が示されています。これらは、アラートの確認とトラブルシューティングを行うのに役立ちます。

  • メールで受け取ったアラートを Azure portal で表示するには、[See in Azure portal] (Azure portal で見る) ボタンを選びます。
  • アラートをトリガーしたアラート ルールを表示または編集するには、[ルールの表示 >] を選びます。
  • アラートがトリガーされたマネージド インスタンスを表示するには、[リソースの表示 >] を選びます。

アラート ルールの管理

Note

Existing alerts need to be managed from the Alerts menu in the Azure portal resource menu. Managed Instance リソース ウィンドウから既存のアラートを変更することはできません。

既存のアラートを表示、中断、アクティブ化、変更および削除するには、次のようにします。

  1. Azure portal の検索を使用して、アラートを検索します。 Select Alerts.

    Azure portal の検索ボックスのスクリーンショット。

    Alternatively, you could also select Alerts on the Azure navigation bar, if you have it configured.

  2. On the Alerts pane, select Alert rules.

    [アラート ルール] ボタンが強調されている、Azure portal の [アラート] ページのスクリーンショット。

  3. 管理する既存のアラート ルールを個別に選択します。 既存のアクティブなルールを、好みに合わせて変更および調整することができます。 アクティブなルールは、削除せずに中断することもできます。