CloudMonitor は、Alibaba Cloud のリソースおよびインターネットアプリケーションをモニタリングし、アラートルールに基づいてアラートをトリガーします。 アラートは、しきい値アラートとイベントアラートに分類されます。 CloudMonitor は、アラート通知について複数の方法をサポートしています。 Log Service のアラート取り込みシステムを CloudMonitor コンソールから設定し、 CloudMonitor のアラートを Log Service に取り込むことができます。 Log Service のアラートシステムでアラートのノイズが除去された上でアラート通知が送信されます。
始める前に
- アラート取り込みアプリケーションが作成されている必要があります。 アラート取り込みアプリケーションのプロトコルパラメーターは CloudMonitor に設定されています。 詳細については、「アラート取り込み用 Webhook URL の設定」をご参照ください。
- アラートの連絡先およびアラートの連絡先グループが作成されている必要があります。 アラートの連絡先は、アラートの連絡先グループに追加されます。 詳細については、「アラーム送信先とアラーム送信先グループの作成」をご参照ください。
CloudMonitor コンソールによるアラートの連絡先とアラートの通知方法の設定
アラートの言語を指定する

アラートの重大度のマッピング
次の表に、CloudMonitor のアラートの重大度と Log Service のアラートの重大度とのマッピングを示します。
CloudMonitor | Log Service |
---|---|
CRITICAL | critical |
WARN | medium |
INFO | info |
しきい値アラートの解析
CloudMonitor のしきい値アラートの Log Service アラートシステムへの取り込み後、Log Service は対応するアラートを生成します。 以下に、2 つのアラート間のマッピングの例を示します。
- CloudMonitor のしきい値アラートの例
CloudMonitor のしきい値アラートの詳細については、「アラームコールバックを作成する」をご参照ください。
{ "alertName": "Connections", "alertState": "ALERT", "curValue": "4.5", "dimensions": "{instanceId=i-bp1d7111111115htda, state=TCP_TOTAL, userId=11596111111355}", "expression": "$Average>=1", "instanceName": "launch-advisor-20210607/11.**.***.111", "lastTime": "27 days, 19 hours, and 47 minutes", "metricName": "Host.tcpconnection", "metricProject": "acs_ecs", "namespace": "acs_ecs", "preTriggerLevel": "WARN", "productGroupName": "null", "rawMetricName": "net_tcpconnection", "regionId": "cn-hangzhou", "regionName": "China (Hangzhou)", "ruleId": "i-bp11111111115111_111111-0703-4811-9113-1c1111111111", "signature": "F111111w1111qN1111bw=", "timestamp": "1625455812126", "triggerLevel": "WARN", "userId": "11596111111355" }
- Log Service アラートの例
CloudMonitor しきい値アラートが Log Service に取り込まれると、フィールドマッピングにより Log Service 対応のアラートに変換されます。 以下に、Log Service アラートのコンテンツの例を示します。
{ "aliuid": "aliuid1", "alert_instance_id": "", "alert_id": "i-bp11111111115111_111111-0703-4811-9113-1c1111111111", "alert_type": "sls_pub", "alert_name": "Connections", "region": "cn-hangzhou", "project": "sls-alert--", "project_id": 0, "next_eval_interval": 0, "alert_time": 1625455812, "fire_time": 1625455812, "fire_results": null, "fire_results_count": 0, "resolve_time": 0, "status": "firing", "results": null, "labels": { "instanceId": "i-bp1d7111111115htda", "namespace": "acs_ecs", "regionId": "cn-hangzhou", "state": "TCP_TOTAL", "userId": "11596111111355" }, "annotations": { "__cloud_monitor_type__": "threshold", "__config_app__": "sls_pub_alert", "__pub_alert_app__": "appid1", "__pub_alert_protocol__": "cloud_monitor", "__pub_alert_region__": "e", "__pub_alert_service__": "serverid1", "curValue": "4.5", "desc": "Host.tcpconnection $Average>=1 lasts for: 27 days, 19 hours, and 47 minutes. Details: {instanceId=i-bp1d7111111115htda, state=TCP_TOTAL, userId=11596111111355}", "expression": "$Average\u003e=1", "instanceName": "launch-advisor-20210607/11.**.**.1111", "lastTime": "27 days, 19 hours, and 47 minutes", "metricName": "Host.tcpconnection", "metricProject": "acs_ecs", "namespace": "acs_ecs", "preTriggerLevel": "WARN", "rawMetricName": "net_tcpconnection", "title": "acs_ecs Host.tcpconnection Current value: 4.5" }, "severity": 6, "policy": { "alert_policy_id": "", "action_policy_id": "", "use_default": false, "repeat_interval": "0s" }, "template": null, "drill_down_query": "https://cloudmonitor.console.aliyun.com/index.htm#/alarmInfo/name=i-bp11111111115111_111111-0703-4811-9113-1c1111111111\u0026searchValue=\u0026searchType=name\u0026searchProduct=/history//" }
- フィールドマッピング
下表に、Log Service のアラート属性と CloudMonitor のアラートフィールドのマッピングを示します。
Log Service CloudMonitor 説明 aliuid なし アラート取り込みアプリケーションが属する Alibaba Cloud アカウントの ID 。 alert_id ruleId アラートモニタリングルールの ID。 alert_type なし アラートのタイプ。 有効な値は、sls_pub です。 alert_name alertName アラートモニタリングルールのルール名。 status alertState アラートのステータス。 - CloudMonitor のアラートの alertState フィールドの値が OK の場合、Log Service の status フィールドの値は resolved です。
- CloudMonitor のアラートの alertState フィールドの値が OK ではない場合、Log Service の status フィールドの値は firing です。
next_eval_interval なし アラートが評価される間隔。 有効値は 0 です。 alert_time timestamp Log Service が CloudMonitor のアラートを受信した時刻。 fire_time timestamp Log Service が CloudMonitor のアラートを受信した時刻。 resolve_time なし アラートの解除時刻。 alertState フィールドの値が OK の場合、resolve_time フィールドの値は現在の時刻です。 ステータスフィールドの値が OK でない場合、resolve_time フィールドの値は 0 です。 labels dimensions アラートのラベル。 - regionId フィールドは、CloudMonitor アラートの regionId フィールドにマッピングされます。
- namespaceフィールドは、CloudMonitor アラートの namespace フィールドまたは metricProject フィールドにマッピングされます。
注 アラート取り込みアプリケーションの作成時に [エンリッチメント] タブでラベルを追加すると、ラベルは labels フィールドに追加されます。annotations なし CloudMonitor アラートの Log Service への取り込み後、以下のフィールドが対応する Log Service アラートの annotations フィールドに追加されます。 - __cloud_monitor_type__: "threshold"
- __config_app__: "sls_pub_alert"
- __pub_alert_service__: {アラート取り込みサービスの ID}
- __pub_alert_app__: {アラート取り込みアプリケーションの ID}
- __pub_alert_protocol__: "cloud_monitor"
- __pub_alert_region__: {アラートが送信されるエンドポイントのリージョン}
CloudMonitor アラートが Log Service に取り込まれても、以下のフィールドは対応する Log Service アラートの annotations フィールドに追加されません: ruleId 、alertName 、alertState 、dimensions、signature、timestamp、 regionId 、 regionName 、 triggerLevel 、userId。
注 アラート取り込みアプリケーションの作成時に [エンリッチメント] タブに注釈を追加した場合、注釈は annotations フィールドに追加されます。severity triggerLevel および preTriggerLevel アラートの重大度。 詳細については、「重大度レベル」をご参照ください。 policy なし アラート取り込みアプリケーションに指定されているアラートポリシー。 詳細については、「ポリシー変数のデータ構造」をご参照ください。 project なし アラートセンターが属するプロジェクト。 詳細については、「プロジェクト」をご参照ください。 region regionId プロジェクトが属するリージョン。 drill_down_query なし この値はリンクです。 リンクは、CloudMonitor コンソールの URL および ruleId フィールドの値で構成されます。 リンクをクリックすると、CloudMonitor コンソールの[アラート履歴] ページに移動します。
イベントアラートの解析
CloudMonitor のイベントアラートが Log Service アラートシステムに取り込まれると、Log Service は対応するアラートを生成します。 以下に、2 つのアラート間のマッピングの例を示します。
- CloudMonitor のイベントアラートの例
CloudMonitor のイベントアラートについての詳細は、「t2057433.html#task_2057433」をご参照ください。
{ "traceId": "411112-c49d-4143-a38e-c111159e-0", "resourceId": "acs:ecs:cn-hangzhou:115111111111355:instance/i-bp1d71111111x15htda", "product": "ECS", "ver": "1.0", "instanceName": "launch-advisor-20210607", "level": "INFO", "userId": "115111111111355", "content": { "resourceId": "i-bp1d7411111111g111htda", "publicIpAddress": "127.0.0.1", "instanceName": "launch-advisor-20210607", "state": "Running", "privateIpAddress": "127.0.0.1", "resourceType": "ALIYUN::ECS::Instance" }, "regionId": "cn-hangzhou", "eventTime": "20210705T113013.398+0800", "name": "Instance:StateChange", "id": "26111205-51113-4D118-8119-3111113CB735", "timeMetrics": { "ingestion_in_time": 1625455813563, "ingestion_out_time": 1625455816000, "notify_in_time": 1625455819578, "engine_in_time": 1625455816467, "event_time": 1625455813398, "engine_out_time": 1625455818000 }, "status": "Normal" }
- Log Service のアラートの例
CloudMonitor イベントアラートは、Log Service への取り込み後にフィールドマッピングにより Log Service 対応のアラートに変換されます。 以下に、Log Service アラートのコンテンツの例を示します。
{ "aliuid": "aliuid1", "alert_instance_id": "26111205-51113-4D118-8119-3111113CB735", "alert_id": "Instance:StateChange", "alert_type": "sls_pub", "alert_name": "Instance:StateChange", "region": "cn-hangzhou", "project": "sls-alert--", "project_id": 0, "next_eval_interval": 0, "alert_time": 1625455813, "fire_time": 1625743445, "fire_results": null, "fire_results_count": 0, "resolve_time": 0, "status": "firing", "results": null, "labels": { "resourceId": "acs:ecs:cn-hangzhou:115111111111355:instance/i-bp1d71111111x15htda" }, "annotations": { "__cloud_monitor_type__": "event", "__config_app__": "sls_pub_alert", "__pub_alert_app__": "appid1", "__pub_alert_protocol__": "cloud_monitor", "__pub_alert_region__": "e", "__pub_alert_service__": "serverid1", "content_instanceName": "launch-advisor-20210607", "content_privateIpAddress": "127.0.0.1", "content_publicIpAddress": "127.0.0.1", "content_resourceId": "i-bp1d7411111111g111htda", "content_resourceType": "ALIYUN::ECS::Instance", "content_state": "Running", "desc": "The Instance:StateChange event alert is triggered. Details: {\"instanceName\":\"launch-advisor-20210607\",\"privateIpAddress\":\"127.0.0.1\",\"publicIpAddress\":\"127.0.0.1\",\"resourceId\":\"i-bp1d7411111111g111htda\",\"resourceType\":\"ALIYUN::ECS::Instance\",\"state\":\"Running\"}", "instanceName": "launch-advisor-20210607", "level": "INFO", "product": "ECS", "status": "Normal", "title": "Instance:StateChange: Normal", "traceId": "411112-c49d-4143-a38e-c111159e-0", "userId": "115111111111355" }, "severity": 4 "policy": { "alert_policy_id": "", "action_policy_id": "", "use_default": false, "repeat_interval": "0s" }, "template": null, "drill_down_query": "https://cloudmonitor.console.aliyun.com/index.htm#/eventmonitoring/events/detail?product=ECS\u0026eventName=Instance:StateChange" }
- フィールドマッピング
下表に、Log Service のアラート属性と CloudMonitor のアラートフィールドのマッピングを示します。
Log Service CloudMonitor 説明 aliuid なし アラート取り込みアプリケーションが属する Alibaba Cloud アカウントの ID 。 alert_instance_id id アラートの ID。 alert_id name アラートモニタリングルールのルール名。 alert_type なし アラートのタイプ。 有効な値は、sls_pub です。 alert_name name アラートモニタリングルールのルール名。 status なし アラートのステータス。 有効な値は、firing です。 next_eval_interval なし アラートが評価される間隔。 有効な値は 0 です。 alert_time なし Log Service が CloudMonitor のアラートを受信した時刻。 fire_time eventTime eventTime フィールドの値が解析され、タイムスタンプに変換されます。 resolve_time なし アラートの解除時刻。 有効値は 0 です。 labels なし アラートのラベル。 regionId フィールドは、CloudMonitor アラートの regionId フィールドにマッピングされます。
注 アラート取り込みアプリケーションの作成時に [エンリッチメント] タブでラベルを追加すると、ラベルは labels フィールドに追加されます。annotations なし CloudMonitor アラートが Log Service に取り込まれると、対応する Log Service アラートの annotations フィールドに以下のフィールドが追加されます。 - __cloud_monitor_type__: "event"
- __config_app__: "sls_pub_alert"
- _pub_alert_service__: {アラート取り込みサービスの ID}
- __pub_alert_app__: {アラート取り込みアプリケーションの ID}
- __pub_alert_protocol__: "cloud_monitor"
- __pub_alert_region__: {アラートが送信されるエンドポイントのリージョン}
CloudMonitor アラートが Log Service に取り込まれても、以下のフィールドは対応する Log Service アラートの annotation フィールドに追加されません:name、id、eventTime 、timeMetrics 、content、ver、resourceId。
content フィールドのキーと値のペアが展開され、キーと値のペアそれぞれの先頭に content_ が追加されます。例:"content_snapshotType": "timer".
注 アラート取り込みアプリケーションの作成時に [エンリッチメント] タブで注釈を追加した場合、注釈は annotations フィールドに追加されます。severity level アラートの重大度。 詳細については、「重大度レベル」をご参照ください。 policy なし アラート取り込みアプリケーションに指定されているアラートポリシー。 詳細については、「ポリシー変数のデータ構造」をご参照ください。 project なし アラートセンターが属するプロジェクト。 詳細については、「プロジェクト」をご参照ください。 region regionId プロジェクトが属するリージョン。 drill_down_query なし この値はリンクです。 リンクは、CloudMonitor コンソールの URL、product フィールドの値、および name フィールドの値で構成されます。 リンクをクリックすると、CloudMonitor コンソールの[イベントモニタリング] ページに移動します。