'Create a GCP metric that shows how often each endpoint is called

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?



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kirk Kelsey