服务商概述

Google Cloud Monitoring(原 Stackdriver)是 Google Cloud 的原生可观测性平台,于 2010 年以 Stackdriver 品牌推出,后整合为 Google Cloud 的统一监控方案。Cloud Monitoring 提供 GCP 全服务的指标自动采集、告警策略、仪表盘、Uptime Checks 和 Service Monitoring 能力。Cloud Logging 提供了集中的日志管理和实时流式分析。Error Reporting 自动聚合和分析应用错误。Cloud Monitoring 与 Google Cloud 的 AI 平台(Vertex AI)深度集成,支持 AI 模型监控和 MLOps 场景。适合以 GCP 为主的云原生团队使用。

核心优势

  • GCP 全服务预集成:Compute Engine、GKE、Cloud Run、BigQuery 等全部 GCP 服务自动向 Cloud Monitoring 上报指标,创建资源即获得监控。参见 网站监控工具选型指南。
  • 日志-指标-错误三合一:Cloud Monitoring 与 Cloud Logging、Error Reporting 深度集成,可在同一平台跨日志、指标和错误数据关联分析,减少工具切换。
  • Managed Prometheus 原生接入:GCP 提供原生托管的 Prometheus 服务(Managed Prometheus),兼容 PromQL 查询和 Grafana 仪表盘,适合已使用 Prometheus 标准的团队。结合 监控最佳实践可构建标准化监控体系。
  • 灵活的告警策略:Cloud Monitoring 告警策略支持基于指标阈值、指标缺失数据、PromQL 查询条件和日志条件的组合触发,减少误报。
  • Uptime Checks 全球探测:覆盖全球 30+ 探测点的可用性监控,支持 HTTP、HTTPS 和 SSL/TLS 证书到期检测,主动发现服务故障。

产品生态

Cloud Monitoring

Cloud Monitoring 是核心监控服务,自动采集 GCP 资源的指标(CPU、内存、网络等)并存储到 Metrics 时间序列数据库。支持自定义指标通过 Monitoring API 或 OpenTelemetry 写入。监控仪表盘支持折线图、热力图、分布图等多种图表类型。Service Monitoring 功能可自动发现和管理微服务拓扑,提供 SLA/SLO/SLI 管理。

Cloud Logging

Cloud Logging 提供 GCP 资源和应用日志的集中采集、存储和实时流式分析。支持基于日志路由(Log Router)的灵活分发,可将日志导出到 BigQuery、Cloud Storage、Pub/Sub 进行进一步处理。Logs Explorer 提供基于查询语言的日志搜索和可视化。日志支持自动解析 JSON 和结构化日志格式。

Error Reporting

Error Reporting 自动聚合和分析 GCP 服务中产生的应用错误,支持分组去重、异常堆栈分类和趋势分析。错误事件可触发 Cloud Monitoring 告警,与 Cloud Logging 集成可一键跳转到关联日志。支持 Java、Python、Node.js、Go 等语言的错误格式解析。

Managed Prometheus

Managed Prometheus 是 GCP 的原生托管 Prometheus 服务,兼容 PromQL 和 Prometheus 指标格式。支持通过 GKE 集群自动发现目标采集指标,无需自行管理 Prometheus 服务器。采集的指标可直接在 Cloud Monitoring 中查询和配置告警,也可在 Grafana 中可视化。适合已采用 Prometheus 标准的容器化环境。

Uptime Checks

Uptime Checks 提供全球 30+ 监控节点对 HTTP/HTTPS 端点的可用性探测,支持 SSL 证书到期检测和内容验证(匹配响应正文中的关键词)。探测结果自动写入 Cloud Monitoring 指标,可配置告警策略。支持 Check Frequency 从 1 分钟到 15 分钟的灵活配置。

不足之处

  • 非 GCP 资源采集方案有限:混合云场景需安装 ops-agent 或使用 Managed Prometheus 采集器,配置复杂度高于 AWS CloudWatch 的 Agent 方案。
  • MQL 学习成本:Cloud Monitoring 的高级查询和仪表盘配置需要理解 Monitoring Query Language(MQL),并非简单拖拽即可完成。PromQL 用户则可以通过 Managed Prometheus 避免。
  • 跨项目视图配置复杂:跨项目和跨组织的 Metrics Scope 配置流程较多,对于大型多项目 GCP 环境初始设置需要一定时间。
  • 免费层额度有限:免费层包含有限的指标和日志额度,大规模使用后详细的 Logging 存储和 Log Router 出口费用需要关注。

适用场景

  • GCP 全托管用户(★★★★★):Cloud Monitoring 是 GCP 用户的基础监控方案,与 Google Cloud Console 和 IAM 深度集成。参见 CDN 日志分析与监控。
  • Prometheus 标准团队(★★★★★):Managed Prometheus 原生集成让 PromQL 用户获得零运维的托管 Prometheus 体验。
  • GKE 容器化应用(★★★★☆):GKE 与 Cloud Monitoring、Managed Prometheus 的预集成为 Kubernetes 监控提供开箱即用体验。
  • 需要 AI/ML 监控的团队(★★★★☆):Cloud Monitoring 与 Vertex AI 的集成支持模型性能和特征监控的 MLOps 场景。
  • 混合云环境(★★★☆☆):非 GCP 资源采集需要 ops-agent 或第三方集成,建议对比 第三方监控方案。

价格参考

服务 免费额度 超出后定价
平台指标 自动免费 免费
Cloud Monitoring 自定义指标 $0.25/月/指标
Cloud Logging 摄入 50 GB/月/项目(日志) $0.50/GB(日志摄入)
Cloud Logging 存储 30 天默认(日志) $0.01/GB/月(活跃)/$0.0025/GB/月(归档)
Managed Prometheus 指标 免费(前 3 百万样本/月) $0.01/百万样本
Uptime Checks 100 次/月/探测点免费 $0.50/千次探测

注:Google Cloud Monitoring 费用包含在 GCP 统一账单中。建议使用 Cloud Billing Budgets 设置预算告警。

常见问题

  • Cloud Monitoring 和 Stackdriver 是什么关系? Stackdriver 是 Google Cloud Monitoring 的前身品牌名。2016 年 Google 收购 Stackdriver 后逐步将其整合为 Cloud Monitoring 和 Cloud Logging,不再使用 Stackdriver 品牌。可参考 云监控服务对比。
  • Cloud Monitoring 可以监控非 GCP 资源吗? 可以。在非 GCP 主机上安装 ops-agent 或使用 Managed Prometheus 采集器即可接入 Cloud Monitoring。但功能完整度不如 GCP 原生资源。可参考 云监控服务对比。
  • Cloud Monitoring 和 Datadog 怎么选? Cloud Monitoring 优势在于 GCP 原生零成本基础监控和 Managed Prometheus 集成;Datadog 优势在于多云统一体验和更丰富的企业集成。GCP 为主的团队选 Cloud Monitoring,多云团队选 Datadog。可参考 云监控服务对比。
  • Managed Prometheus 和自建 Prometheus 有什么不同? Managed Prometheus 免去 Prometheus 服务器本身的运维(高可用、存储、扩展),指标存储在 Cloud Monitoring 的后端,支持 PromQL 查询。对于已在使用 Prometheus 标准的团队,迁移成本极低。可参考 Prometheus 监控搭建指南。
  • Error Reporting 支持哪些语言的错误解析? Error Reporting 支持 Java、Python、Node.js、Go、Ruby、PHP 和 .NET 等主流语言的错误堆栈解析和分组去重。可参考 Sentry 错误监控配置指南。