Google Stackdrive 自定义指标 - 数据保留期

Google Stackdrive custom metrics - data retention period

我正在使用 GCP Stackdrive 自定义指标并创建了一些仪表板图表来显示系统上的流量。问题是图形系统将数据保留几周 - 而不是永远。

来自 Stackdrive documentation:

See Quotas and limits for limits on the number of custom metrics and the number of active time series, and for the data retention period. If you wish to keep your metric data beyond the retention period, you must manually copy the data to another location, such as Cloud Storage or BigQuery.

让我们决定使用 Cloud Storage 作为长期存储数据的容器。

问题:

  1. 这个 "manual data copy" 是如何运作的?只需将相同的数据写入两个地方(Google 存储和 Stackdrive)?
  2. stackdrive 是如何连接它的存储和生成图的?

您可以使用 Stackdriver 的 Logs Export feature to export your logs into either of three sinks, Google Cloud Storage, BigQuery or Pub/Sub topic. Here are the instructions on how to export stackdriver logs。您不是实时在两个地方写入日志,而是根据您设置的过滤器导出日志。

要记住的一件事是,您将无法对导出的日志使用堆栈驱动程序图或警报工具。

此外,如果您将日志导出到 bigquery,您可以插入一个 Datastudio graphe 来查看您的指标。

您也可以使用 Cloud Storage 导出来执行此操作,但它不太直接且不太方便

我将推荐本指南,介绍如何创建管道以将指标导出到 BigQuery 以进行长期存储和分析。 https://cloud.google.com/solutions/stackdriver-monitoring-metric-export