创建一个 GCP 指标,显示每个端点的调用频率
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还可以定义用户定义的基于日志的指标 使用正则表达式为作业提取标签姓名。
也就是说,云运行的现有
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.