如何从正常运行时间检查中获取正常运行时间百分比

时间:2021-06-30 07:09:39

标签: google-cloud-stackdriver google-cloud-monitoring uptime uptime-monitoring website-monitoring

Uptime Percentage

我想将上图中的正常运行时间百分比提取到我正在制作的第三方应用程序中。我浏览了各种文档,但找不到任何东西!

有人可以指导我吗?

1 个答案:

答案 0 :(得分:1)

目前无法生成此类指标/图表来显示 VM 的正常运行时间百分比。

您可以尝试使用 cloud trace API 提取该信息。

另一种方法可能是使用 MQL 查询来创建自定义指标,以显示按小时/天等汇总的总正常运行时间。

fetch gce_instance
| metric 'compute.googleapis.com/instance/uptime'
| filter (metric.instance_name == 'instance-1')
| align delta(1d)
| every 1d
| group_by [], [value_uptime_mean: mean(value.uptime)]

enter image description here

此外,您可能会发现这些答案很有帮助:

How to generate uptime reports through Google Cloud Stackdriver?

How to get uptime total and percentage of GCP compute vm instance through MQL?

Get google cloud uptime history to a third party application