Monitorare le metriche delle richieste App Check per Cloud Functions
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Dopo aver aggiunto l'SDK App Check alla tua app, ma prima di attivare l'applicazione di App Check, devi assicurarti che questa operazione non interrompa l'attività dei tuoi utenti legittimi esistenti.
Per Cloud Functions, puoi ottenere le metriche App Check esaminando i log delle tue funzioni. Ogni chiamata di una funzione chiamabile genera una voce di log strutturata
come nel seguente esempio:
{"severity":"INFO",// INFO, WARNING, or ERROR"logging.googleapis.com/labels":{"firebase-log-type":"callable-request-verification"},"jsonPayload":{"message":"Callable header verifications passed.","verifications":{// ..."app":"MISSING",// VALID, INVALID, or MISSING}}}
Quando avrai compreso l'impatto di App Check sui tuoi utenti e sarai pronto per procedere, potrai attivare l'applicazione di App Check per Cloud Functions.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-08-23 UTC."],[],[],null,["After you add the App Check SDK to your app, but before you enable\nApp Check enforcement, you should make sure that doing so won't disrupt your\nexisting legitimate users.\n\nFor Cloud Functions, you can get App Check metrics by examining your\nfunctions' logs. Every invocation of a callable function emits a structured log\nentry like the following example: \n\n {\n \"severity\": \"INFO\", // INFO, WARNING, or ERROR\n \"logging.googleapis.com/labels\": {\"firebase-log-type\": \"callable-request-verification\"},\n \"jsonPayload\": {\n \"message\": \"Callable header verifications passed.\",\n \"verifications\": {\n // ...\n \"app\": \"MISSING\", // VALID, INVALID, or MISSING\n }\n }\n }\n\nYou can analyze these metrics in the Google Cloud console by [creating a\nlogs-based counter metric](https://cloud.google.com/logging/docs/logs-based-metrics/counter-metrics)\nwith the following metric filter: \n\n```\nresource.type=\"cloud_function\"\nresource.labels.function_name=\"YOUR_CLOUD_FUNCTION\"\nresource.labels.region=\"us-central1\"\nlabels.firebase-log-type=\"callable-request-verification\"\n```\n\n[Label the metric](https://cloud.google.com/logging/docs/logs-based-metrics/labels#create-label)\nusing the field `jsonPayload.verifications.appCheck`.\n\nNext steps\n\nWhen you understand how App Check will affect your users and you're ready to\nproceed, you can [enable App Check enforcement](/docs/app-check/cloud-functions)\nfor Cloud Functions."]]