如何查看 Google 云 运行 应用程序的请求计数(不是速率)?
How can I see request count (not rate) for a Google Cloud Run application?
我在 docker 容器中部署了 Google 云 运行 服务 运行。开箱即用,看起来我可以深入了解服务页面的“指标”选项卡上的一些指标,例如请求计数、请求延迟等。虽然听起来请求计数可以回答我的问题,但我真正想要的是对采用的洞察力,以便我可以回答 "How many visits to my application were there in the past week" 或类似的问题。有没有办法立即获得这样的洞察力?
目前,请求计数指标报告 responses/second,因此我可以看到看起来像“0.05/s”的光点,这可以给我一些见解,但很难汇总。
我也尝试过使用“监控”>“指标”浏览器,但我没有看到 select 指标的任何数据。如果这看起来像建议的解决方案,我正在考虑从我的应用程序中连接到 Google 分析。谢谢!
我意识到让 Metrics Explorer 在 "how many requests I received this month" 上给你一个直接的答案是相当困难的。但是,这是可能的:
如您所说,转到 Metrics Explorer,选择资源类型 "Cloud Run Revision" (cloud_run_revision
),您将看到 "Request Count" (run.googleapis.com/request_count
) 指标:
Description: Number of requests reaching the revision. Excludes requests that are not reaching your container instances (e.g. unauthorized requests or when maximum number of instances is reached).
Resource type: cloud_run_revision
Unit: number Kind: Delta Value type: Int64
然后,选择聚合器:None,然后单击显示高级选项。在表单中,选择 Aligner: sum(而不是默认的 "Rate" default)。您现在应该能够看到每分钟的总请求数:
现在,如果您将 "Alignment Period" 更改为“10 分钟”,您将每 10 米看到一个数据点(遗憾的是,似乎有一个错误显示 X req/s,但那是在这种情况下更像是 X reqs/10m):
如果您收集到足够的数据,您可以将 "Alignment Period" 更改为 "Custom" 并设置 30 天,然后将顶部的时间范围更新为 1 年并查看每月请求数。
这个不会显示所有对齐周期的总和(我认为这部分由您手动完成,也许可以通过 API),但它让您查看每月的请求。例如,这是我已经 运行 几个月的一项服务,我将调整期设置为 7 天,查看过去 6 周,因此我获得了每周请求计数的 6 个数据点。希望这有帮助。
我在 docker 容器中部署了 Google 云 运行 服务 运行。开箱即用,看起来我可以深入了解服务页面的“指标”选项卡上的一些指标,例如请求计数、请求延迟等。虽然听起来请求计数可以回答我的问题,但我真正想要的是对采用的洞察力,以便我可以回答 "How many visits to my application were there in the past week" 或类似的问题。有没有办法立即获得这样的洞察力?
目前,请求计数指标报告 responses/second,因此我可以看到看起来像“0.05/s”的光点,这可以给我一些见解,但很难汇总。
我也尝试过使用“监控”>“指标”浏览器,但我没有看到 select 指标的任何数据。如果这看起来像建议的解决方案,我正在考虑从我的应用程序中连接到 Google 分析。谢谢!
我意识到让 Metrics Explorer 在 "how many requests I received this month" 上给你一个直接的答案是相当困难的。但是,这是可能的:
如您所说,转到 Metrics Explorer,选择资源类型 "Cloud Run Revision" (cloud_run_revision
),您将看到 "Request Count" (run.googleapis.com/request_count
) 指标:
Description: Number of requests reaching the revision. Excludes requests that are not reaching your container instances (e.g. unauthorized requests or when maximum number of instances is reached).
Resource type: cloud_run_revision
Unit: number Kind: Delta Value type: Int64
然后,选择聚合器:None,然后单击显示高级选项。在表单中,选择 Aligner: sum(而不是默认的 "Rate" default)。您现在应该能够看到每分钟的总请求数:
现在,如果您将 "Alignment Period" 更改为“10 分钟”,您将每 10 米看到一个数据点(遗憾的是,似乎有一个错误显示 X req/s,但那是在这种情况下更像是 X reqs/10m):
如果您收集到足够的数据,您可以将 "Alignment Period" 更改为 "Custom" 并设置 30 天,然后将顶部的时间范围更新为 1 年并查看每月请求数。
这个不会显示所有对齐周期的总和(我认为这部分由您手动完成,也许可以通过 API),但它让您查看每月的请求。例如,这是我已经 运行 几个月的一项服务,我将调整期设置为 7 天,查看过去 6 周,因此我获得了每周请求计数的 6 个数据点。希望这有帮助。