创建一个 GCP 指标,显示每个端点的调用频率

发布于 2025-01-13 19:40:29 字数 210 浏览 1 评论 0原文

我正在使用 Google Cloud Run 来托管运行expressjs的nodejs。我有一堆由调度程序调用的端点。所以基本上每个端点都是一个工作或任务。我想知道每个任务被调用的频率。

每次调用端点时,我都会打印到日志START:JobName。是否可以过滤掉 JobName 并将每个作业单独绘制在一个图表上,显示每个作业的运行频率?

I'm using Google Cloud Run to host nodejs running expressjs. I have a bunch of endpoints that are called by a scheduler. So basically each endpoint is a job or task. I want to know how often each task is called.

I print to the log every time an endpoint is called START: JobName. Is it possible to filter out the JobName and graph each job separately on one chart showing how often each job is run?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拥抱影子 2025-01-20 19:40:29

您还可以定义用户定义的基于日志的指标 使用正则表达式为作业提取标签姓名。

也就是说,云运行的现有 request_count GPC 指标 可以按project_id、service_name、revision_name、location、configuration_name、response_code、response_code_class 和route 进行分组。这可能会给你同样的可见度。

You could also define a user-defined log based metric with a regular expression to extract a label for the job name.

That said, the existing request_count GPC metric for cloud run can be grouped by project_id, service_name, revision_name, location, configuration_name, response_code, response_code_class, and route. that might give you the same visibility.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文