本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
針對 EventBridge 全域端點設定 Route 53 健全狀況檢查
使用全域端點時,您必須進行 Route 53 運作狀態檢查才能監控區域的狀態。以下範本定義了 Amazon CloudWatch 警示,並使用它來定義 Route 53 運作狀態檢查。
AWS CloudFormation 用於定義 Route 53 健康狀態檢查的範本
使用下列範本來定義 Route 53 運作狀態檢查。
Description: |- Global endpoints health check that will fail when the average Amazon EventBridge latency is above 30 seconds for a duration of 5 minutes. Note, missing data will cause the health check to fail, so if you only send events intermittently, consider changing the heath check to use a longer evaluation period or instead treat missing data as 'missing' instead of 'breaching'. Metadata: AWS::CloudFormation::Interface: ParameterGroups: - Label: default: "Global endpoint health check alarm configuration" Parameters: - HealthCheckName - HighLatencyAlarmPeriod - MinimumEvaluationPeriod - MinimumThreshold - TreatMissingDataAs ParameterLabels: HealthCheckName: default: Health check name HighLatencyAlarmPeriod: default: High latency alarm period MinimumEvaluationPeriod: default: Minimum evaluation period MinimumThreshold: default: Minimum threshold TreatMissingDataAs: default: Treat missing data as Parameters: HealthCheckName: Description: Name of the health check Type: String Default: LatencyFailuresHealthCheck HighLatencyAlarmPeriod: Description: The period, in seconds, over which the statistic is applied. Valid values are 10, 30, 60, and any multiple of 60. MinValue: 10 Type: Number Default: 60 MinimumEvaluationPeriod: Description: The number of periods over which data is compared to the specified threshold. You must have at least one evaluation period. MinValue: 1 Type: Number Default: 5 MinimumThreshold: Description: The value to compare with the specified statistic. Type: Number Default: 30000 TreatMissingDataAs: Description: Sets how this alarm is to handle missing data points. Type: String AllowedValues: - breaching - notBreaching - ignore - missing Default: breaching Mappings: "InsufficientDataMap": "missing": "HCConfig": "LastKnownStatus" "breaching": "HCConfig": "Unhealthy" Resources: HighLatencyAlarm: Type: AWS::CloudWatch::Alarm Properties: AlarmDescription: High Latency in Amazon EventBridge MetricName: IngestionToInvocationStartLatency Namespace: AWS/Events Statistic: Average Period: !Ref HighLatencyAlarmPeriod EvaluationPeriods: !Ref MinimumEvaluationPeriod Threshold: !Ref MinimumThreshold ComparisonOperator: GreaterThanThreshold TreatMissingData: !Ref TreatMissingDataAs LatencyHealthCheck: Type: AWS::Route53::HealthCheck Properties: HealthCheckTags: - Key: Name Value: !Ref HealthCheckName HealthCheckConfig: Type: CLOUDWATCH_METRIC AlarmIdentifier: Name: Ref: HighLatencyAlarm Region: !Ref AWS::Region InsufficientDataHealthStatus: !FindInMap [InsufficientDataMap, !Ref TreatMissingDataAs, HCConfig] Outputs: HealthCheckId: Description: The identifier that Amazon Route 53 assigned to the health check when you created it. Value: !GetAtt LatencyHealthCheck.HealthCheckId
事件IDs可能會隨著API呼叫而變更,因此跨區域的事件關聯需要您具有不可變的唯一識別碼。消費者也應該考慮等冪性的設計。如此一來,如果您要複製事件,或從封存中重新播放事件,兩個區域中處理的事件就不會產生任何副作用。
CloudWatch 警示範本屬性
注意
針對所有 editable
欄位,請考慮每秒輸送量。如果您只是間歇性地傳送事件,請考慮將健康檢查變更為使用較長的評估期間,或者改為將遺失的資料視為 missing
而非 breaching
。
以下屬性用於模板的 CloudWatch 警報部分:
指標 | 描述 |
---|---|
|
警示的說明。 預設: |
|
與警示相關聯的指標名稱。這對以指標為基礎的警示是必要的。針對以數學運算式為基礎的警示,您要改用 預設值: IngestionToInvocationStartLatency |
|
與警示相關聯之指標的命名空間。這對以指標為基礎的警示是必要的。針對以數學運算式為基礎的警示,您不能指定 預設: |
|
除百分位數外,與警示相關聯的指標統計。 預設值:平均值 |
|
套用統計資料的期間 (以秒為單位)。這對以指標為基礎的警示是必要的。有效值為 10、30、60,以及 60 的任何倍數。 預設: |
|
執行資料和指定閾值比較作業的週期。如果您設定的警示需連續違反數個資料點才能觸發警示,則此值會指定該數目。如果您要設定「N 個中有 M 個」的警示,則此值為 N,且 預設: |
|
要與指定統計資料比較的值。 預設: |
|
與指定的統計資料和閾值比較時,要使用的算術操作。指定的統計值會作為第一個運算元使用。 預設: |
|
設定此警示處理缺失資料點的方式。 有效值: 預設: |
路由 53 運作狀態檢查範本屬性
注意
針對所有 editable
欄位,請考慮每秒輸送量。如果您只是間歇性地傳送事件,請考慮將健康檢查變更為使用較長的評估期間,或者改為將遺失的資料視為 missing
而非 breaching
。
下列屬性用於範本的 Route 53 運作狀態檢查區段:
指標 | 描述 |
---|---|
|
運作狀態檢查的名稱。 預設: |
|
當 CloudWatch 指標相關資料不足以判斷警示狀態時,您希望 Amazon Route 53 指派給運作狀態檢查的狀態 有效值:
預設值:狀態不良 注意此欄位會根據對 |