Sie können sich die Messwerte für API-Aufrufe auf der Seite API-Übersicht in der Google Cloud Console ansehen.
Schließlich können Sie die Kontingentmesswerte sowohl für API-Aufrufe als auch Funktionsausführung auf der Seite API-Kontingente in der Google Cloud Console anzeigen. Sie können in Cloud Monitoring Benachrichtigungen zu Kontingentfehlern einrichten. Dazu filtern Sie nach Ausführungen, deren Wert für das Messwertlabel STATUS das Kontingent überschreitet (out of quota). Weitere Informationen finden Sie unter Einführung in Benachrichtigungen.
Messwerte programmatisch lesen
Das folgende Snippet zeigt, wie Sie auch Messwerte aus Ihrem Code lesen können.
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();
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-04-14 (UTC)."],[[["You can view Cloud Run function metrics like execution times, counts, and memory usage in the Google Cloud console and Cloud Monitoring."],["Metrics for API calls can be viewed on the API overview page in the Google Cloud console."],["Quota metrics for API calls and function execution are available in the API quotas page of the Google Cloud console."],["You can set up alerts for quota errors in Cloud Monitoring by filtering executions with an `out of quota` status."],["Metrics can also be read programmatically from your code using the Google Cloud client library, as shown in the provided Node.js example."]]],[]]