針對 EventBridge 全域端點設定 Route 53 健全狀況檢查 - Amazon EventBridge

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

針對 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 警報部分:

指標 描述

AlarmDescription

警示的說明。

預設:High Latency in Amazon EventBridge

MetricName

與警示相關聯的指標名稱。這對以指標為基礎的警示是必要的。針對以數學運算式為基礎的警示,您要改用 Metrics,而且不能指定 MetricName

預設值: IngestionToInvocationStartLatency

Namespace

與警示相關聯之指標的命名空間。這對以指標為基礎的警示是必要的。針對以數學運算式為基礎的警示,您不能指定 Namespace,要改用 Metrics

預設:AWS/Events

Statistic

除百分位數外,與警示相關聯的指標統計。

預設值:平均值

Period

套用統計資料的期間 (以秒為單位)。這對以指標為基礎的警示是必要的。有效值為 10、30、60,以及 60 的任何倍數。

預設:60

EvaluationPeriods

執行資料和指定閾值比較作業的週期。如果您設定的警示需連續違反數個資料點才能觸發警示,則此值會指定該數目。如果您要設定「N 個中有 M 個」的警示,則此值為 N,且 DatapointsToAlarm 為 M。

預設:5

Threshold

要與指定統計資料比較的值。

預設:30,000

ComparisonOperator

與指定的統計資料和閾值比較時,要使用的算術操作。指定的統計值會作為第一個運算元使用。

預設:GreaterThanThreshold

TreatMissingData

設定此警示處理缺失資料點的方式。

有效值:breachingnotBreachingignoremissing

預設:breaching

路由 53 運作狀態檢查範本屬性

注意

針對所有 editable 欄位,請考慮每秒輸送量。如果您只是間歇性地傳送事件,請考慮將健康檢查變更為使用較長的評估期間,或者改為將遺失的資料視為 missing 而非 breaching

下列屬性用於範本的 Route 53 運作狀態檢查區段:

指標 描述

HealthCheckName

運作狀態檢查的名稱。

預設:LatencyFailuresHealthCheck

InsufficientDataHealthStatus

當 CloudWatch 指標相關資料不足以判斷警示狀態時,您希望 Amazon Route 53 指派給運作狀態檢查的狀態

有效值:

  • Healthy:Route 53 將這些運作狀態檢查視為正常。

  • Unhealthy:Route 53 將這些運作狀態檢查視為狀況不良。

  • LastKnownStatus:Route 53 使用上次具 CloudWatch 有足夠資料來判斷警示狀態的健康狀態檢查狀態。對於沒有上次已知狀態的新運作狀態檢查,運作狀態檢查的預設狀態是正常。

預設值:狀態不良

注意

此欄位會根據對 TreatMissingData 欄位的輸入進行更新。如果設定 TreatingMissingDataMissing,則會將其更新為 LastKnownStatus。如果 TreatingMissingData 設定為 Breaching,則會將其更新為 Unhealthy