使用 CloudWatch Logs 疑難排解警示管理員 - Amazon Managed Service for Prometheus

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

使用 CloudWatch Logs 疑難排解警示管理員

使用 使用 CloudWatch Logs 監控 Amazon Managed Service for Prometheus 事件 時,您可以進行警示管理員和尺規相關問題的疑難排解。本節包含警示管理員相關的疑難排解主題。

作用中提醒警告

日誌包含下列警告

{ "workspaceId": "ws-efdc5b42-b051-11ec-b123-4567ac120002", "message": { "log": "too many alerts, limit: 1000", "level": "WARN" }, "component": "alertmanager" }

這表示超過警示管理員作用中警示配額。

採取動作

請求提高配額。登入 AWS Management Console ,並在 https://https://console.aws.amazon.com/servicequotas/ 開啟 Service Quotas 主控台。

警示彙總群組大小警告

日誌包含下列警告

{ "workspaceId": "ws-efdc5b42-b051-11ec-b123-4567ac120002", "message": { "log": "Too many aggregation groups, cannot create new group for alert, groups=1000, limit=1000, alert=sample-alert", "level": "WARN" }, "component": "alertmanager" }

這表示已超過警示管理員警示彙總群組大小配額。

採取動作

使用 group_by 參數減少警示彙總群組大小。如需詳細資訊,請參閱 Prometheus 文件中的路由相關設定

您還可以請求增加配額。登入 AWS Management Console ,並在 https://https://console.aws.amazon.com/servicequotas/ 開啟 Service Quotas 主控台。

提醒大小太大警告

日誌包含下列警告

{ "workspaceId": "ws-efdc5b42-b051-11ec-b123-4567ac120002", "message": { "log": "alerts too big, total size limit: 20000000 bytes", "level": "WARN" }, "component": "alertmanager" }

這表示已超過每個工作區大小配額的警示管理員警示。

採取動作

移除不必要的註釋和標籤,以減少提醒大小。

空內容警告

日誌包含下列警告

{ "workspaceId": "ws-abcd1234-ef56-78ab-cd90-1234abcd0000", "message": { "log": "Message has been modified because the content was empty." "level": "WARN" }, "component": "alertmanager" }

這表示警示管理員範本將外傳警示解析為空白訊息。

採取動作

驗證您的警示管理員範本,並確保您擁有適用於所有接收者路徑的有效範本。

無效的 key/value 警告

日誌包含下列警告

{ "workspaceId": "ws-abcd1234-ef56-78ab-cd90-1234abcd0000", "message": { "log": "MessageAttributes has been removed because of invalid key/value, numberOfRemovedAttributes=1" "level": "WARN" }, "component": "alertmanager" }

這表示由於鍵值/值無效,因此已移除某些訊息屬性。

採取動作

重新評估您用來填入訊息屬性的範本,並確定其解析為有效的 SNS 訊息屬性。如需驗證 Amazon SNS 主題的訊息的詳細資訊,請參閱驗證 SNS 主題

訊息限制警告

日誌包含下列警告

{ "workspaceId": "ws-abcd1234-ef56-78ab-cd90-1234abcd0000", "message": { "log": "Message has been truncated because it exceeds size limit, originSize=266K, truncatedSize=12K" "level": "WARN" }, "component": "alertmanager" }

這表示某些訊息大小過大。

採取動作

查看警示接收器訊息模板,然後重新調整以符合大小限制。

無資源型政策錯誤

日誌包含下列錯誤

{ "workspaceId": "ws-abcd1234-ef56-78ab-cd90-1234abcd0000", "message": { "log": "Notify for alerts failed, AMP is not authorized to perform: SNS:Publish on resource: arn:aws:sns:us-west-2:12345:testSnsReceiver because no resource-based policy allows the SNS:Publish action" "level": "ERROR" }, "component": "alertmanager" }

這表示 Amazon Managed Service for Prometheus 沒有將警示提交至指定 SNS 主題的許可。

採取動作

驗證 Amazon SNS 主題的存取政策是否授予 Amazon Managed Service for Prometheus 將 SNS 訊息傳送至主題的能力。建立 SNS 存取政策,讓服務 aps.amazonaws.com(Amazon Managed Service for Prometheus) 存取您的 Amazon SNS 主題。如需 SNS 存取政策的詳細資訊,請參閱《Amazon Simple Notification Service 開發人員指南》中的使用 Amazon SNS 存取控制的存取政策語言和範例案例。 Amazon SNS

非 ASCII 警告

日誌包含下列警告

{ "workspaceId": "ws-abcd1234-ef56-78ab-cd90-1234abcd0000", "message": { "log": "Subject has been modified because it contains control or non-ASCII characters." "level": "WARN" }, "component": "alertmanager" }

這表示主題具有非 ASCII 字元。

採取動作

移除範本主旨欄位中可能包含非 ASCII 字元標籤的參考。

未獲授權呼叫 KMS

當日誌包含下列 AWS KMS 錯誤時

{ "workspaceId": "ws-abcd1234-ef56-78ab-cd90-1234abcd0000", "message": { "log": "Notify for alerts failed, AMP is not authorized to call KMS", "level": "ERROR" }, "component": "alertmanager" }

採取動作

驗證用於加密 Amazon SNS 主題之金鑰的金鑰政策是否允許 Amazon Managed Service for Prometheus 服務主體aps.amazonaws.com執行下列動作:kms:GenerateDataKey*、 和 kms:Decrypt。如需詳細資訊,請參閱 SNS 主題的AWS KMS 許可

範本錯誤

日誌包含下列錯誤

{ "workspaceId": "ws-efdc5b42-b051-11ec-b123-4567ac120002", "message": { "log": "Notify for alerts failed. There is an error in a receiver that is using templates in the AlertManager definition. Make sure that the syntax is correct and only template functions and variables that exist are used in the receiver 'default', sns_configs position #2, section 'attributes'" "level": "ERROR" }, "component": "alertmanager" }

這表示在 AlertManager 定義中使用的範本中發生錯誤。錯誤項目包含有關什麼接收器、sns_configs 中的位置以及包含錯誤的 屬性的指示。

採取動作

驗證您的警示管理員定義。請確定語法正確,且您參考存在的範本變數和函數。如需詳細資訊,請參閱 Prometheus 開放原始碼文件中的通知範本參考