> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tenderly.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Alerts 简介

> 监听链上事件，并通过 Email、Slack、PagerDuty 及其他告警目标实时接收通知。

<Note>
  Alerts 在付费套餐中提供。如需为您的账户启用，请 [联系我们的销售团队](https://tenderly.co/contact-us)。
</Note>

Tenderly Alerting 监听区块链上的事件，并在事件发生时向您所需的目标发送实时通知。目标可以是 Email、您喜欢的即时通信应用、事件监控系统，或者 webhook 和 Web3 Actions。

借助 Tenderly Alerting，您可以随时了解与事务、钱包、智能合约或网络上任何其他活动相关的期望或异常事件。这使您能够更快地发现并解决智能合约事务问题。Alerts 还可帮助您尽早发现运营、代码或安全问题。

借助 [Alerts API](/monitoring/alerts/api)，您可以创建复杂的触发条件。

跳转到以下快速链接，开始使用 Tenderly Alerting：

* [**快速入门指南**](/monitoring/alerts/tutorials/quickstart)
* [**如何为告警设置 webhook**](/monitoring/alerts/tutorials/webhooks)
* [**使用 Alerting API**](/monitoring/alerts/api)。
* [**告警触发器和目标**](/monitoring/alerts/types)
* [**告警目标**](/monitoring/alerts/destinations/overview)

<iframe src="https://www.youtube.com/embed/I9XeubHXnIA" style={{ aspectRatio: 16 / 9, width: '100%' }} />

## Alert 的组成

每个 Alert 在启用前都需要配置三个要素：

* **Alert Type：** 触发 Tenderly 向您发送通知的链上事件。有 12 种告警触发器类型可供选择。
* **Alert Target：** 您希望 Tenderly 监控的地址，以及其他设置，例如网络、项目和标签。
* **Alert Destination：** 用于接收特定事件通知的服务。一个 Alert 可以将通知发送到多个目标。您可以在 8 种目标类型中发送和接收通知。

## Alert 触发器类型概览

下面列出所有 12 种告警触发器类型及其简要描述。点击链接查看配置详情。

| 触发器类型                                                                         | 描述                                      | 常见用例                         |
| ----------------------------------------------------------------------------- | --------------------------------------- | ---------------------------- |
| [**Successful Transaction**](/monitoring/alerts/types#successful-transaction) | 当事务被成功打包时触发。                            | 监控合约调用或钱包活动。                 |
| [**Failed Transaction**](/monitoring/alerts/types#failed-transaction)         | 当事务未能被打包时触发。                            | 及早发现使用或代码问题。                 |
| [**Function Call**](/monitoring/alerts/types#function-call)                   | 当合约上的特定 `external` 或 `public` 函数被调用时触发。 | 跟踪特定的合约交互。                   |
| [**Event Emitted**](/monitoring/alerts/types#event-emitted)                   | 当合约发出特定事件时触发。                           | 监控 ERC-20 授权、转账等。            |
| [**Event Parameter**](/monitoring/alerts/types#event-parameter)               | 当事件参数与您定义的条件匹配时触发。                      | 转账金额超过阈值时告警。                 |
| [**ERC20 Token Transfer**](/monitoring/alerts/types#erc20-token-transfer)     | 当 ERC-20 Transfer 事件被发出时触发。             | 跟踪进出某个地址的代币流动。               |
| [**Allowlisted Callers**](/monitoring/alerts/types#allowlisted-callers)       | 当不在您允许列表中的地址调用合约时触发。                    | 检测未授权的调用者。                   |
| [**Blocklisted Callers**](/monitoring/alerts/types#blocklisted-callers)       | 当您阻止列表中的地址调用合约时触发。                      | 监视已知的恶意行为者或未授权钱包。            |
| [**Balance Change**](/monitoring/alerts/types#balance-change)                 | 当事务后原生代币余额匹配某个条件时触发。                    | 知道何时该为 keeper 或机器人钱包充值。      |
| [**Transaction Value**](/monitoring/alerts/types#transaction-value)           | 当事务的价值（以 wei 计）匹配某个条件时触发。               | 跟踪高价值事务。                     |
| [**State Change**](/monitoring/alerts/types#state-change)                     | 当合约中某个数值状态变量发生变化时触发。                    | 监控多签确认数或配置变量。                |
| [**View Function**](/monitoring/alerts/types#view-function)                   | 当事务后某个 `view` 函数的返回值发生变化时触发。            | 通过 `balanceOf` 跟踪 ERC-20 余额。 |

## Alert Destinations 概览

所有这些告警触发器都可以配置为向便于团队协作的地方发送实时通知。

在您喜欢的即时通信应用中接收通知：

* [**Email**](/monitoring/alerts/destinations/account-scoped#email-destination)
* [**Slack**](/monitoring/alerts/destinations/account-scoped#slack-destination)
* [**Telegram**](/monitoring/alerts/destinations/account-scoped#telegram-destination)
* [**Discord**](/monitoring/alerts/destinations/account-scoped#discord-destination)

将告警数据发送到其他 Tenderly 系统：

* [**Web3 Actions**](/monitoring/alerts/destinations/project-scoped#web3-actions)
* [**Webhooks**](/monitoring/alerts/destinations/project-scoped#webhooks)

将告警数据发送到第三方事件和错误监控平台，例如：

* [**Sentry**](/monitoring/alerts/destinations/account-scoped#sentry-destination)
* [**PagerDuty**](/monitoring/alerts/destinations/account-scoped#pagerduty-destination)

在此了解 [如何设置每种 Alert Destination](/monitoring/alerts/destinations/overview)。

## 使用 Tenderly Alerting 可以做什么？

Tenderly Alerting 在多种场景下提供价值。无论何时，只要您需要一个可靠的链上活动告警系统来提示潜在的风险或威胁，都可以依赖 Tenderly Alerting。

* **监控链上活动：** 可以将 Alerts 用作监控工具，跟踪智能合约上的用户活动，例如失败或成功的事务或状态变化。这在您需要跟踪区块链环境中的特定事件或变化时非常有用。
* **检测可疑行为：** Alerts 可以告知您智能合约或钱包上的可疑行为，例如安全漏洞或欺诈活动。这可帮助您采取适当措施来保护资产、防止损失。
* **在紧急情况下更快响应：** Alerts 还可帮助您检测错误、安全问题或失败的事务。这在您需要在问题发生后立即采取行动解决时非常有用。
* **为团队提供更高的可见性：** 您可以按需求配置每个 Alert，包括为团队设置便捷的通知位置。
* **启用自动化流程：** 将 Alerts 用作 Web3 Actions 的触发器，构建自定义的自动化流程，让您能够使用自定义代码自动响应链上事件。
