מעקב אחרי מדדי הבקשות לבדיקת אפליקציות ל-Cloud Functions
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
אחרי שמוסיפים את App Check SDK לאפליקציה, אבל לפני שמפעילים את האכיפה של App Check, צריך לוודא שהפעולה הזו לא תשבש את השימוש של המשתמשים הלגיטימיים הקיימים.
במקרה של Cloud Functions, אפשר לקבל מדדים של App Check על ידי בדיקת היומנים של הפונקציות. כל הפעלה של פונקציה שאפשר לקרוא לה יוצרת רשומה של יומן מובנה, כמו בדוגמה הבאה:
{
"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
}
}
}
אפשר לנתח את המדדים האלה במסוף Google Cloud על ידי יצירת מדד מונה שמבוסס על יומנים עם מסנן המדדים הבא:
resource.type="cloud_function"
resource.labels.function_name="YOUR_CLOUD_FUNCTION"
resource.labels.region="us-central1"
labels.firebase-log-type="callable-request-verification"
נותנים למדד תווית באמצעות השדה jsonPayload.verifications.appCheck
.
השלבים הבאים
אחרי שתבינו איך App Check ישפיע על המשתמשים שלכם ותהיו מוכנים להמשיך, תוכלו להפעיל את האכיפה של App Check ב-Cloud Functions.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-23 (שעון UTC).
[null,null,["עדכון אחרון: 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."]]