

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

# 使用 Amazon EventBridge 監控 OpenSearch Serverless 事件
<a name="serverless-monitoring-events"></a>

Amazon OpenSearch Service 與 Amazon EventBridge 整合，可通知您影響您的網域的特定事件。來自 AWS 服務的事件會以近乎即時的方式交付至 EventBridge。相同的事件也會傳送至 [Amazon CloudWatch Events](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatchEvents.html)，或 Amazon EventBridge 的前身產品。您可以撰寫規則來指出您感興趣的事件，以及在事件符合規則時要採取哪些自動化動作。您可以自動啟用的動作範例包括下列項目：
+ 叫用 AWS Lambda 函數
+ 叫用 Amazon EC2 執行命令
+ 將事件轉傳至 Amazon Kinesis Data Streams
+ 啟用 AWS Step Functions 狀態機器
+ 通知 Amazon SNS 主題或 Amazon SQS 佇列

如需詳細資訊，請參閱 *Amazon EventBridge 使用者指南*中的 [Amazon EventBridge 入門](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-get-started.html)。

## 設定通知
<a name="monitoring-events-notifications"></a>

您可以使用[AWS 使用者通知](https://docs.aws.amazon.com/notifications/latest/userguide/what-is-service.html)，在發生 OpenSearch Serverless 事件時接收通知。事件是 OpenSearch Serverless 環境中變更的指標，例如當您達到 OCU 用量上限時。 Amazon EventBridge 會接收事件並將通知路由至 AWS 管理主控台 通知中心和您選擇的交付管道。當事件符合您指定的規則時，便會收到通知。

## OpenSearch 運算單位 (OCU) 事件
<a name="monitoring-events-ocu"></a>

OpenSearch Serverless 會將事件傳送至 EventBridge。

### 接近上限的 OCU 用量
<a name="monitoring-events-ocu-approaching-max"></a>

當您的搜尋或索引 OCU 用量達到容量限制的 75% 時，OpenSearch Serverless 會傳送此事件。您的 OCU 用量是根據您設定的容量限制和目前的 OCU 使用量來計算。

**範例**

以下是此類型 （搜尋 OCU) 的範例事件：

```
{
  "version": "0",
  "id": "01234567-0123-0123-0123-012345678901",
  "detail-type": "OCU Utilization Approaching Max Limit",
  "source": "aws.aoss",
  "account": "123456789012",
  "time": "2016-11-01T13:12:22Z",
  "region": "us-east-1",
  "resources": ["arn:aws:es:us-east-1:123456789012:domain/test-domain"],
  "detail": {
    "eventTime" : 1678943345789,
    "description": "Your search OCU usage is at 75% and is approaching the configured maximum limit."
  }
}
```

以下是此類型 （索引 OCU) 的範例事件：

```
{
  "version": "0",
  "id": "01234567-0123-0123-0123-012345678901",
  "detail-type": "OCU Utilization Approaching Max Limit",
  "source": "aws.aoss",
  "account": "123456789012",
  "time": "2016-11-01T13:12:22Z",
  "region": "us-east-1",
  "resources": ["arn:aws:es:us-east-1:123456789012:domain/test-domain"],
  "detail": {
    "eventTime" : 1678943345789,
    "description": "Your indexing OCU usage is at 75% and is approaching the configured maximum limit."
  }
```

### OCU 用量達到上限
<a name="monitoring-events-ocu-approaching-max"></a>

當您的搜尋或索引 OCU 用量達到容量限制的 100% 時，OpenSearch Serverless 會傳送此事件。您的 OCU 用量是根據您設定的容量限制和目前的 OCU 使用量來計算。

**範例**

以下是此類型 （搜尋 OCU) 的範例事件：

```
{
  "version": "0",
  "id": "01234567-0123-0123-0123-012345678901",
  "detail-type": "OCU Utilization Reached Max Limit",
  "source": "aws.aoss",
  "account": "123456789012",
  "time": "2016-11-01T13:12:22Z",
  "region": "us-east-1",
  "resources": ["arn:aws:es:us-east-1:123456789012:domain/test-domain"],
  "detail": {
    "eventTime" : 1678943345789,
    "description": "Your search OCU usage has reached the configured maximum limit."
  }
}
```

以下是此類型 （索引 OCU) 的範例事件：

```
{
  "version": "0",
  "id": "01234567-0123-0123-0123-012345678901",
  "detail-type": "OCU Utilization Reached Max Limit",
  "source": "aws.aoss",
  "account": "123456789012",
  "time": "2016-11-01T13:12:22Z",
  "region": "us-east-1",
  "resources": ["arn:aws:es:us-east-1:123456789012:domain/test-domain"],
  "detail": {
    "eventTime" : 1678943345789,
    "description": "Your indexing OCU usage has reached the configured maximum limit."
  }
}
```