If you are creating a new function, see theConsole Quickstarton Cloud Run. The content on this page only applies to existing legacy functions created with the Cloud Functions v1 API.
You can view the metrics for API calls in theAPI overview pageof the Google Cloud console.
Finally, you can view the quota metrics for both API calls and function
execution in theAPI quotas pageof the Google Cloud console. You can set up alerting on quota errors inCloud Monitoringby filtering executions that have anout of quotavalue for theSTATUSmetric label. SeeIntroduction to Alertingfor more information.
Reading metrics programmatically
The following snippet illustrates how you can also read metrics from your code.
Node.js
// Imports the Google Cloud client libraryconstmonitoring=require('@google-cloud/monitoring');// Creates a clientconstclient=newmonitoring.MetricServiceClient();asyncfunctionreadTimeSeriesData(){/*** TODO(developer): Uncomment and edit the following lines of code.*/// const projectId = 'YOUR_PROJECT_ID';// const filter = 'metric.type="compute.googleapis.com/instance/cpu/utilization"';constrequest={name:client.projectPath(projectId),filter:filter,interval:{startTime:{// Limit results to the last 20 minutesseconds:Date.now()/1000-60*20,},endTime:{seconds:Date.now()/1000,},},};// Writes time series dataconst[timeSeries]=awaitclient.listTimeSeries(request);timeSeries.forEach(data=>{console.log(`${data.metric.labels.instance_name}:`);data.points.forEach(point=>{console.log(JSON.stringify(point.value));});});}readTimeSeriesData();
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-24 UTC."],[],[]]