简体   繁体   English

如何设置 GCP 云监控 (Stackdriver) 警报策略周期大于 24 小时?

[英]How to set a GCP Cloud Monitoring (Stackdriver) alert policy period greater than 24 hours?

Currently 24 hours is the limit of time a Cloud Monitoring (erstwhile Stackdriver) alert policy can be set.当前 24 小时是可以设置 Cloud Monitoring(以前的 Stackdriver)警报策略的时间限制。

However, if you have a daily activity, like a database backup, it might take a little more or less time each day (eg run in 1 hour 10min one day, 1 hour 12min the next day).但是,如果您有日常活动,例如数据库备份,则每天可能会花费更多或更少的时间(例如,一天运行 1 小时 10 分钟,第二天运行 1 小时 12 分钟)。 In this case, you might not see your completion indicator until 24 hours and 2 minutes since the prior indicator.在这种情况下,您可能要等到上一个指示器 24 小时 2 分钟后才能看到完成指示器。 This will cause Cloud Monitoring to issue an alert (because you are +2min over the alerting window limit).这将导致 Cloud Monitoring 发出警报(因为您超过警报 window 限制 +2 分钟)。

Is there a way to better handle the variance in these alerts, like a 25 hour look back period?有没有办法更好地处理这些警报中的差异,例如 25 小时回顾期?

Currently, there is no way to increase the period time over 24 hours.目前,没有办法增加超过 24 小时的周期时间。

However, there is a Feature Request already opened for that.但是,已经为此打开了一个功能请求。

You can follow it in this public link [1].您可以在此公共链接 [1] 中关注它。

Cheers,干杯,


[1] https://issuetracker.google.com/175703606 [1] https://issuetracker.google.com/175703606

I found a work around to this problem.我找到了解决这个问题的方法。

  1. Create a metric for when your job starts (eg started_metric )为您的工作开始时创建一个指标(例如started_metric
  2. Create a metric for when your job finishes (eg completed_metric )为您的工作完成时间创建一个指标(例如completed_metric

Now create a two part Alert Policy现在创建一个由两部分组成的警报策略

  1. Require that started_metric occurs once per 24 hours要求started_metric每 24 小时发生一次
  2. Require that completed_metric occurs once per 24 hours要求completed_metric每 24 小时发生一次
  3. Trigger if (1) and (2) above are met (eg both > 24 hours)如果满足上述 (1) 和 (2) 则触发(例如均 > 24 小时)

This works around the 24 hour job jitter issue, as the job might take > 24 hours to complete, but it should always start (eg cron job) within 24 hours.这解决了 24 小时作业抖动问题,因为作业可能需要 > 24 小时才能完成,但它应该始终在 24 小时内启动(例如 cron 作业)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 GCP 监控警报政策 - GCP Monitoring Alert policy 如何在 Terraform 中设置基于 GCP 监控日志的警报? - How to set up a GCP Monitoring log-based alert in Terraform? GCP | 云监控 | 如何对项目进行分组以在 Cloud Monitoring 信息中心上显示? - GCP | Cloud Monitoring | How to group projects for display on Cloud Monitoring Dashboard? 用于监控谷歌云发布/订阅的 Stackdriver 延迟 - Stackdriver latency for monitoring google cloud pub/sub GCP 监控中组合指标的缺失数据警报 - Alert on Absent Data for Combined Metric in GCP Monitoring 在 Google Cloud Monitoring 中手动触发警报 - Manually triggering alert in Google Cloud Monitoring 如何在 GCP 控制台中使用 gsutil 下载过去 24 小时内创建的文件? - How to download files which are created in last 24 hours using gsutil in GCP console? 如何通过 terraform 在 GCP Cloud 中禁用 GKE 服务中的日志记录和监控服务 - How to disable logging and monitoring service in GKE service in GCP Cloud via terraform 在 Stackdriver 和 Istio 上监控 GKE - Monitoring GKE on Stackdriver and Istio GCP 云 MySQL 代理的网络策略 - Network Policy for GCP Cloud MySQL Proxy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM