跳转到内容
搜索文档

Logpush 告警与分析

最后更新 查看 MarkdownAgent 设置

Logpush 作业可能因多种原因失败,例如目标不可达、客户源站权限变更,或 Logpush 作业在过去 24 小时内未完成至少一次成功推送。

借助分析与告警,您可以监控 Logpush 作业的健康状况,并在作业失败时自行获知。您可以接收告警,也可以通过 GraphQL 获取 Logpush 作业健康状况的分析数据。

告警通过 Cloudflare Notifications 系统发送,可通过电子邮件或 webhook 送达。订阅作业停用通知后,每个作业每 24 小时最多收到一条告警。通知邮件包含作业 ID 与目标配置。

Failing Logpush Job Disabled

Who is it for?

Enterprise customers who use Logpush and want to monitor their job health.

Other options / filters

  • Notification Name: A custom name for the notification.
  • Description (optional): A custom description for the notification.
  • Notification Email (can be multiple emails): The email address of the recipient for the notification.

Included with

Enterprise plans.

What should you do if you receive one?

In the email for the notification, you can find the destination name for the failing Logpush job. With this destination name, you should be able to figure out which zone this relates to. There can be multiple reasons why a job fails, but it is best to test that the destination endpoint is healthy, and that necessary credentials are still working. You can also check that the destination has allowlisted Cloudflare IPs.

启用告警

您可以在仪表板的 Notifications(通知) 部分添加 Failing Logpush Job Disabled(失败的 Logpush 作业已禁用) 告警。请注意,告警可在账户级别配置,并适用于该账户内的所有作业。

  1. 在 Cloudflare 仪表板中,前往 Notifications(通知) 页面。

    Go to Notifications ↗
  2. 接下来,选择 Add(添加)

  3. 选择告警 Failing Logpush Job Disabled(失败的 Logpush 作业已禁用)

  4. 配置告警:选择名称、添加描述(可选)、选择通知服务、Webhooks,并输入希望接收通知的电子邮件地址。

  5. 选择 Save(保存)

完成这些步骤后,若 Logpush 作业被禁用,您将收到电子邮件告警。

启用 Logpush 健康分析

客户可通过 GraphQL API 查询 Logpush 作业健康指标。数据集名称为 logpushHealthAdaptiveGroups,可使用 GraphQL API 浏览架构。

以下查询用于统计推送到 S3 失败的次数。

query
{
  viewer
  {
    zones(filter: { zoneTag: $zoneTag})
    {
      logpushHealthAdaptiveGroups(filter: {
        datetime_gt:"2022-08-15T00:00:00Z",
        destinationType:"s3",
        status_neq:200
      },
      limit:10)
      {
        count,
        dimensions {
          jobId,
          status,
          destinationType
        }
      }
    }
  }
}

这篇文档对您有帮助吗?